This commit is contained in:
joylink_cuiweidong 2021-09-15 11:00:34 +08:00
commit 109dd75eac
34 changed files with 1850 additions and 1502 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -182,52 +182,96 @@ class Iscs {
const code = elem.code; const code = elem.code;
// 义乌项目暂时写死 // 义乌项目暂时写死
if (elem.deviceType === 'IBP') { if (elem.deviceType === 'IBP') {
if (this.iscsDevice['IscsCircle_20']) { if (this.iscsDevice['IscsCircle_20'] && elem.upStatus) {
elem.upStatus.operate ? this.iscsDevice['IscsCircle_20'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_20'].model.fillColor = '#FF0000'; this.iscsDevice['IscsCircle_20'].model.fillColor = elem.upStatus.operate ? '#0C0' : '#F00';
this.$painter.update(this.iscsDevice['IscsCircle_20']); this.$painter.update(this.iscsDevice['IscsCircle_20']);
} }
if (this.iscsDevice['IscsCircle_17']) { if (this.iscsDevice['IscsCircle_24'] && elem.downStatus) {
elem.upStatus.openCommand ? this.iscsDevice['IscsCircle_17'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_17'].model.fillColor = '#FF0000'; this.iscsDevice['IscsCircle_24'].model.fillColor = elem.downStatus.operate ? '#0C0' : '#F00';
this.$painter.update(this.iscsDevice['IscsCircle_24']);
}
if (this.iscsDevice['IscsCircle_17'] && elem.upStatus) {
this.iscsDevice['IscsCircle_17'].model.fillColor = elem.upStatus.openCommand ? '#0C0' : '#F00';
this.$painter.update(this.iscsDevice['IscsCircle_17']); this.$painter.update(this.iscsDevice['IscsCircle_17']);
} }
if (this.iscsDevice['IscsCircle_18']) { if (this.iscsDevice['IscsCircle_21'] && elem.downStatus) {
elem.upStatus.openSideCommand ? this.iscsDevice['IscsCircle_18'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_18'].model.fillColor = '#FF0000'; this.iscsDevice['IscsCircle_21'].model.fillColor = elem.downStatus.openCommand ? '#0C0' : '#F00';
this.$painter.update(this.iscsDevice['IscsCircle_21']);
}
if (this.iscsDevice['IscsCircle_18'] && elem.upStatus) {
this.iscsDevice['IscsCircle_18'].model.fillColor = elem.upStatus.openSideCommand ? '#0C0' : '#F00';
this.$painter.update(this.iscsDevice['IscsCircle_18']); this.$painter.update(this.iscsDevice['IscsCircle_18']);
} }
if (this.iscsDevice['IscsCircle_19']) { if (this.iscsDevice['IscsCircle_22'] && elem.downStatus) {
elem.upStatus.closeCommand ? this.iscsDevice['IscsCircle_19'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_19'].model.fillColor = '#FF0000'; this.iscsDevice['IscsCircle_22'].model.fillColor = elem.downStatus.openSideCommand ? '#0C0' : '#F00';
this.$painter.update(this.iscsDevice['IscsCircle_22']);
}
if (this.iscsDevice['IscsCircle_19'] && elem.upStatus) {
this.iscsDevice['IscsCircle_19'].model.fillColor = elem.upStatus.closeCommand ? '#0C0' : '#F00';
this.$painter.update(this.iscsDevice['IscsCircle_19']); this.$painter.update(this.iscsDevice['IscsCircle_19']);
} }
if (this.iscsDevice['IscsCircle_23'] && elem.downStatus) {
this.iscsDevice['IscsCircle_23'].model.fillColor = elem.downStatus.closeCommand ? '#0C0' : '#F00';
this.$painter.update(this.iscsDevice['IscsCircle_23']);
}
} else if (elem.deviceType === 'PSL') { } else if (elem.deviceType === 'PSL') {
if (this.iscsDevice['IscsCircle_12']) { if (this.iscsDevice['IscsCircle_12'] && elem.upStatus) {
elem.upStatus.operate ? this.iscsDevice['IscsCircle_12'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_12'].model.fillColor = '#FF0000'; this.iscsDevice['IscsCircle_12'].model.fillColor = elem.upStatus.operate ? '#0C0' : '#F00';
this.$painter.update(this.iscsDevice['IscsCircle_12']); this.$painter.update(this.iscsDevice['IscsCircle_12']);
} }
if (this.iscsDevice['IscsCircle_9']) { if (this.iscsDevice['IscsCircle_13'] && elem.downStatus) {
elem.upStatus.openCommand ? this.iscsDevice['IscsCircle_9'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_9'].model.fillColor = '#FF0000'; this.iscsDevice['IscsCircle_13'].model.fillColor = elem.downStatus.operate ? '#0C0' : '#F00';
this.$painter.update(this.iscsDevice['IscsCircle_13']);
}
if (this.iscsDevice['IscsCircle_9'] && elem.upStatus) {
this.iscsDevice['IscsCircle_9'].model.fillColor = elem.upStatus.openCommand ? '#0C0' : '#F00';
this.$painter.update(this.iscsDevice['IscsCircle_9']); this.$painter.update(this.iscsDevice['IscsCircle_9']);
} }
if (this.iscsDevice['IscsCircle_35']) { if (this.iscsDevice['IscsCircle_14'] && elem.downStatus) {
elem.upStatus.closeCommand ? this.iscsDevice['IscsCircle_35'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_35'].model.fillColor = '#FF0000'; this.iscsDevice['IscsCircle_14'].model.fillColor = elem.downStatus.openCommand ? '#0C0' : '#F00';
this.$painter.update(this.iscsDevice['IscsCircle_14']);
}
if (this.iscsDevice['IscsCircle_35'] && elem.upStatus) {
this.iscsDevice['IscsCircle_35'].model.fillColor = elem.upStatus.closeCommand ? '#0C0' : '#F00';
this.$painter.update(this.iscsDevice['IscsCircle_35']); this.$painter.update(this.iscsDevice['IscsCircle_35']);
} }
if (this.iscsDevice['IscsCircle_37']) { if (this.iscsDevice['IscsCircle_36'] && elem.downStatus) {
elem.upStatus.interlockRelease ? this.iscsDevice['IscsCircle_37'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_37'].model.fillColor = '#FF0000'; this.iscsDevice['IscsCircle_36'].model.fillColor = elem.downStatus.closeCommand ? '#0C0' : '#F00';
this.$painter.update(this.iscsDevice['IscsCircle_36']);
}
if (this.iscsDevice['IscsCircle_37'] && elem.upStatus) {
this.iscsDevice['IscsCircle_37'].model.fillColor = elem.upStatus.interlockRelease ? '#0C0' : '#F00';
this.$painter.update(this.iscsDevice['IscsCircle_37']); this.$painter.update(this.iscsDevice['IscsCircle_37']);
} }
if (this.iscsDevice['IscsCircle_38'] && elem.downStatus) {
this.iscsDevice['IscsCircle_38'].model.fillColor = elem.downStatus.interlockRelease ? '#0C0' : '#F00';
this.$painter.update(this.iscsDevice['IscsCircle_38']);
}
} else if (elem.deviceType === 'SAFETY_CIRCLE') { } else if (elem.deviceType === 'SAFETY_CIRCLE') {
if (this.iscsDevice['IscsCircle_26']) { if (this.iscsDevice['IscsCircle_26'] && elem.upStatus) {
elem.upStatus.pfdcFault ? this.iscsDevice['IscsCircle_26'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_26'].model.fillColor = '#FF0000'; this.iscsDevice['IscsCircle_26'].model.fillColor = elem.upStatus.pfdcFault ? '#0C0' : '#F00';
this.$painter.update(this.iscsDevice['IscsCircle_26']); this.$painter.update(this.iscsDevice['IscsCircle_26']);
} }
if (this.iscsDevice['IscsCircle_25']) { if (this.iscsDevice['IscsCircle_28'] && elem.downStatus) {
elem.upStatus.busFault ? this.iscsDevice['IscsCircle_25'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_25'].model.fillColor = '#FF0000'; this.iscsDevice['IscsCircle_28'].model.fillColor = elem.downStatus.pfdcFault ? '#0C0' : '#F00';
this.$painter.update(this.iscsDevice['IscsCircle_28']);
}
if (this.iscsDevice['IscsCircle_25'] && elem.upStatus) {
this.iscsDevice['IscsCircle_25'].model.fillColor = elem.upStatus.busFault ? '#0C0' : '#F00';
this.$painter.update(this.iscsDevice['IscsCircle_25']); this.$painter.update(this.iscsDevice['IscsCircle_25']);
} }
if (this.iscsDevice['IscsCircle_27']) { if (this.iscsDevice['IscsCircle_29'] && elem.downStatus) {
elem.upStatus.safetyCircle ? this.iscsDevice['IscsCircle_27'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_27'].model.fillColor = '#FF0000'; this.iscsDevice['IscsCircle_29'].model.fillColor = elem.downStatus.busFault ? '#0C0' : '#F00';
this.$painter.update(this.iscsDevice['IscsCircle_29']);
}
if (this.iscsDevice['IscsCircle_27'] && elem.upStatus) {
this.iscsDevice['IscsCircle_27'].model.fillColor = elem.upStatus.safetyCircle ? '#0C0' : '#F00';
this.$painter.update(this.iscsDevice['IscsCircle_27']); this.$painter.update(this.iscsDevice['IscsCircle_27']);
} }
if (this.iscsDevice['IscsCircle_30'] && elem.downStatus) {
this.iscsDevice['IscsCircle_30'].model.fillColor = elem.downStatus.safetyCircle ? '#0C0' : '#F00';
this.$painter.update(this.iscsDevice['IscsCircle_30']);
}
} else if (elem.deviceType === 'SLIDING_DOOR') { } else if (elem.deviceType === 'SLIDING_DOOR') {
const upPsdCodeList = ['FuzhouPsd_33', 'FuzhouPsd_34', 'FuzhouPsd_35', 'FuzhouPsd_36', 'FuzhouPsd_41', 'FuzhouPsd_42', 'FuzhouPsd_43', 'FuzhouPsd_44', const upPsdCodeList = ['FuzhouPsd_33', 'FuzhouPsd_34', 'FuzhouPsd_35', 'FuzhouPsd_36', 'FuzhouPsd_41', 'FuzhouPsd_42', 'FuzhouPsd_43', 'FuzhouPsd_44',
'FuzhouPsd_61', 'FuzhouPsd_62', 'FuzhouPsd_63', 'FuzhouPsd_64', 'FuzhouPsd_69', 'FuzhouPsd_70', 'FuzhouPsd_71', 'FuzhouPsd_72', 'FuzhouPsd_65', 'FuzhouPsd_61', 'FuzhouPsd_62', 'FuzhouPsd_63', 'FuzhouPsd_64', 'FuzhouPsd_69', 'FuzhouPsd_70', 'FuzhouPsd_71', 'FuzhouPsd_72', 'FuzhouPsd_65',
@ -235,11 +279,11 @@ class Iscs {
const downPsdCodeList = ['FuzhouPsd_1', 'FuzhouPsd_2', 'FuzhouPsd_3', 'FuzhouPsd_4', 'FuzhouPsd_9', 'FuzhouPsd_10', 'FuzhouPsd_11', 'FuzhouPsd_12', const downPsdCodeList = ['FuzhouPsd_1', 'FuzhouPsd_2', 'FuzhouPsd_3', 'FuzhouPsd_4', 'FuzhouPsd_9', 'FuzhouPsd_10', 'FuzhouPsd_11', 'FuzhouPsd_12',
'FuzhouPsd_17', 'FuzhouPsd_18', 'FuzhouPsd_20', 'FuzhouPsd_19', 'FuzhouPsd_21', 'FuzhouPsd_22', 'FuzhouPsd_23', 'FuzhouPsd_24', 'FuzhouPsd_25', 'FuzhouPsd_17', 'FuzhouPsd_18', 'FuzhouPsd_20', 'FuzhouPsd_19', 'FuzhouPsd_21', 'FuzhouPsd_22', 'FuzhouPsd_23', 'FuzhouPsd_24', 'FuzhouPsd_25',
'FuzhouPsd_26', 'FuzhouPsd_27', 'FuzhouPsd_28', 'FuzhouPsd_29', 'FuzhouPsd_30', 'FuzhouPsd_31', 'FuzhouPsd_32']; 'FuzhouPsd_26', 'FuzhouPsd_27', 'FuzhouPsd_28', 'FuzhouPsd_29', 'FuzhouPsd_30', 'FuzhouPsd_31', 'FuzhouPsd_32'];
if (this.iscsDevice['IscsCircle_57']) { if (this.iscsDevice['IscsCircle_57'] && elem.downStatus) {
elem.downStatus && elem.downStatus.isolationMode ? this.iscsDevice['IscsCircle_57'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_57'].model.fillColor = '#FF0000'; elem.downStatus && elem.downStatus.isolationMode ? this.iscsDevice['IscsCircle_57'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_57'].model.fillColor = '#FF0000';
this.$painter.update(this.iscsDevice['IscsCircle_57']); this.$painter.update(this.iscsDevice['IscsCircle_57']);
} }
if (this.iscsDevice['IscsCircle_58']) { if (this.iscsDevice['IscsCircle_58'] && elem.upStatus) {
elem.upStatus && elem.upStatus.isolationMode ? this.iscsDevice['IscsCircle_58'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_58'].model.fillColor = '#FF0000'; elem.upStatus && elem.upStatus.isolationMode ? this.iscsDevice['IscsCircle_58'].model.fillColor = '#00CC00' : this.iscsDevice['IscsCircle_58'].model.fillColor = '#FF0000';
this.$painter.update(this.iscsDevice['IscsCircle_58']); this.$painter.update(this.iscsDevice['IscsCircle_58']);
} }

View File

@ -662,15 +662,16 @@ export function Jl3ddeviceNew(dom,group,token,skinCode) {
} }
//根据数据切换设备样式 //根据数据切换设备样式
this.updateaction = function (data) { this.updateaction = function (data) {
if (data.type == "SWITCH") { if (data.type == "SWITCH") {
if (data.normal == "0") { if (data.command == 'NP') {
scope.modelmanager.switchmodel.normalPosition = "0"; scope.modelmanager.switchmodel.normalPosition = data.command;
scope.modelmanager.switchmodel.action.reset(); scope.modelmanager.switchmodel.action.reset();
scope.modelmanager.switchmodel.action.time = 0; scope.modelmanager.switchmodel.action.time = 0;
scope.modelmanager.switchmodel.action.timeScale = 1; scope.modelmanager.switchmodel.action.timeScale = 1;
scope.modelmanager.switchmodel.action.play(); scope.modelmanager.switchmodel.action.play();
} else if (data.normal == "1") { } else if (data.command == 'RP') {
scope.modelmanager.switchmodel.normalPosition = "1"; scope.modelmanager.switchmodel.normalPosition = data.command;
scope.modelmanager.switchmodel.action.reset(); scope.modelmanager.switchmodel.action.reset();
scope.modelmanager.switchmodel.action.time = scope.modelmanager.switchmodel.action._clip.duration; scope.modelmanager.switchmodel.action.time = scope.modelmanager.switchmodel.action._clip.duration;
scope.modelmanager.switchmodel.action.timeScale = -1; scope.modelmanager.switchmodel.action.timeScale = -1;
@ -678,36 +679,79 @@ export function Jl3ddeviceNew(dom,group,token,skinCode) {
} }
} }
if (data.type == "SIGNAL") {//从上往下红绿黄 if (data.type == "SIGNAL") {//从上往下红绿黄
/** 无显示,灭灯 */
if(data.red == 1){ if(data.command == 'No'){
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map = scope.signallights["red"]; scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map.needsUpdate = true; scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map.needsUpdate = true;
}else{ scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map = scope.signallights["black"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map.needsUpdate = true;
}
if(data.yellow == 1){
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map = scope.signallights["yellow"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map.needsUpdate = true; scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map.needsUpdate = true;
}else{ scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map = scope.signallights["black"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map.needsUpdate = true;
}
if(data.green == 1){
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map = scope.signallights["green"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map.needsUpdate = true;
}else{
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map = scope.signallights["black"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map.needsUpdate = true; scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map.needsUpdate = true;
} }
/** 红 */
if(data.command == 'R'){
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map = materials["red"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map.needsUpdate = true;
}
/** 绿 */
if(data.command == 'G'){
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map = materials["green"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map.needsUpdate = true;
}
/** 黄 */
if(data.command == 'Y'){
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map = materials["yellow"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map.needsUpdate = true;
}
/** 月白 */
if(data.command == 'W'){
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map.needsUpdate = true;
}
/** 蓝 */
if(data.command == 'B'){
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map.needsUpdate = true;
}
/** 红黄 */
if(data.command == 'RY'){
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map = materials["red"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d001").material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map = materials["yellow"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d002").material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.getObjectByName("d3d003").material.map.needsUpdate = true;
}
} }
if (data.type == "PSD" || data.type == "STAND") { if (data.type == "PSD" || data.type == "STAND") {
if (data.code == scope.nowcode) { if (data.code == scope.nowcode) {
if (data.open == "1" ) { if (data.command == 'K' ) {
scope.modelmanager.standmodel.screenDoorOpenStatus = "0"; scope.modelmanager.standmodel.screenDoorOpenStatus = data.command;
scope.modelmanager.standmodel.action.reset(); scope.modelmanager.standmodel.action.reset();
scope.modelmanager.standmodel.action.time = 0; scope.modelmanager.standmodel.action.time = 0;
@ -717,8 +761,8 @@ export function Jl3ddeviceNew(dom,group,token,skinCode) {
localVoicePlay("开往"+psdVoiceStationList[data.code].finlStationName+"方向的列车进站了!"); localVoicePlay("开往"+psdVoiceStationList[data.code].finlStationName+"方向的列车进站了!");
} }
if (data.open == "0" ) { if (data.command == 'G' ) {
scope.modelmanager.standmodel.screenDoorOpenStatus = "1"; scope.modelmanager.standmodel.screenDoorOpenStatus = data.command;
scope.modelmanager.standmodel.action.reset(); scope.modelmanager.standmodel.action.reset();
scope.modelmanager.standmodel.action.time = scope.modelmanager.standmodel.action._clip.duration; scope.modelmanager.standmodel.action.time = scope.modelmanager.standmodel.action._clip.duration;

View File

@ -81,7 +81,6 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
return; return;
} }
if(data.type == "DeviceCtrl_3D"){ if(data.type == "DeviceCtrl_3D"){
// console.log(data); // console.log(data);
if (data.body.type== 'SIGNAL' && signallist) { if (data.body.type== 'SIGNAL' && signallist) {
@ -822,12 +821,12 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
// console.log("direct:"+trainmodel.right); // console.log("direct:"+trainmodel.right);
// console.log(trainmodel.openleft); // console.log(trainmodel.openleft);
// console.log(trainmodel.openright); // console.log(trainmodel.openright);
if(trainmodel.code == data.code){ if(trainmodel.code == data.trainCode){
if(trainmodel.right == "0"){ if(trainmodel.right == "0"){
if(data.doorCode == "2"){ if(data.code == "2"){
if(trainmodel.openleft != data.open && data.open == "0"){ if(trainmodel.openleft != data.command && data.command == "G"){
trainmodel.openleft = "0"; trainmodel.openleft = data.command;
for(let an=actions["traindoor"].top.length-1;an>=0;an--){ for(let an=actions["traindoor"].top.length-1;an>=0;an--){
actions["traindoor"].top[an].reset(); actions["traindoor"].top[an].reset();
actions["traindoor"].top[an].time = actions["traindoor"].top[an]._clip.duration; actions["traindoor"].top[an].time = actions["traindoor"].top[an]._clip.duration;
@ -835,8 +834,8 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
actions["traindoor"].top[an].play(); actions["traindoor"].top[an].play();
} }
}else if(trainmodel.openleft != data.open && data.open == "1"){ }else if(trainmodel.openleft != data.command && data.command == "K"){
trainmodel.openleft = "1"; trainmodel.openleft = data.command;
for(let an=actions["traindoor"].top.length-1;an>=0;an--){ for(let an=actions["traindoor"].top.length-1;an>=0;an--){
actions["traindoor"].top[an].reset(); actions["traindoor"].top[an].reset();
actions["traindoor"].top[an].time = 0; actions["traindoor"].top[an].time = 0;
@ -847,16 +846,16 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
}else{ }else{
if (trainmodel.openright != data.open && data.open == '0') { if (trainmodel.openright != data.command && data.command == 'G') {
trainmodel.openright = '0'; trainmodel.openright = data.command;
for (let an=actions["traindoor"].down.length-1; an>=0; an--) { for (let an=actions["traindoor"].down.length-1; an>=0; an--) {
actions["traindoor"].down[an].reset(); actions["traindoor"].down[an].reset();
actions["traindoor"].down[an].time = actions["traindoor"].down[an]._clip.duration; actions["traindoor"].down[an].time = actions["traindoor"].down[an]._clip.duration;
actions["traindoor"].down[an].timeScale = -1; actions["traindoor"].down[an].timeScale = -1;
actions["traindoor"].down[an].play(); actions["traindoor"].down[an].play();
} }
} else if (trainmodel.openright != data.open && data.open == '1') { } else if (trainmodel.openright != data.command && data.command == 'K') {
trainmodel.openright = "1"; trainmodel.openright = data.command;
for(let an=actions["traindoor"].down.length-1;an>=0;an--){ for(let an=actions["traindoor"].down.length-1;an>=0;an--){
actions["traindoor"].down[an].reset(); actions["traindoor"].down[an].reset();
actions["traindoor"].down[an].time = 0; actions["traindoor"].down[an].time = 0;
@ -867,18 +866,18 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
} }
}else{ }else{
if(data.doorCode == "1"){ if(data.code == "1"){
if(trainmodel.openleft != data.open && data.open == "0"){ if(trainmodel.openleft != data.command && data.command == "G"){
trainmodel.openleft = "0"; trainmodel.openleft = data.command;
for(let an=actions["traindoor"].top.length-1;an>=0;an--){ for(let an=actions["traindoor"].top.length-1;an>=0;an--){
actions["traindoor"].top[an].reset(); actions["traindoor"].top[an].reset();
actions["traindoor"].top[an].time = actions["traindoor"].top[an]._clip.duration; actions["traindoor"].top[an].time = actions["traindoor"].top[an]._clip.duration;
actions["traindoor"].top[an].timeScale = -1; actions["traindoor"].top[an].timeScale = -1;
actions["traindoor"].top[an].play(); actions["traindoor"].top[an].play();
} }
}else if(trainmodel.openleft != data.open && data.open == "1"){ }else if(trainmodel.openleft != data.command && data.command == "K"){
trainmodel.openleft = "1"; trainmodel.openleft = data.command;
for(let an=actions["traindoor"].top.length-1;an>=0;an--){ for(let an=actions["traindoor"].top.length-1;an>=0;an--){
actions["traindoor"].top[an].reset(); actions["traindoor"].top[an].reset();
actions["traindoor"].top[an].time = 0; actions["traindoor"].top[an].time = 0;
@ -887,16 +886,16 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
} }
} }
}else{ }else{
if (trainmodel.openright != data.open && data.open == '0') { if (trainmodel.openright != data.command && data.command == 'G') {
trainmodel.openright = '0'; trainmodel.openright = data.command;
for (let an=actions["traindoor"].down.length-1; an>=0; an--) { for (let an=actions["traindoor"].down.length-1; an>=0; an--) {
actions["traindoor"].down[an].reset(); actions["traindoor"].down[an].reset();
actions["traindoor"].down[an].time = actions["traindoor"].down[an]._clip.duration; actions["traindoor"].down[an].time = actions["traindoor"].down[an]._clip.duration;
actions["traindoor"].down[an].timeScale = -1; actions["traindoor"].down[an].timeScale = -1;
actions["traindoor"].down[an].play(); actions["traindoor"].down[an].play();
} }
} else if (trainmodel.openright != data.open && data.open == '1') { } else if (trainmodel.openright != data.command && data.command == 'K') {
trainmodel.openright = "1"; trainmodel.openright = data.command;
for(let an=actions["traindoor"].down.length-1;an>=0;an--){ for(let an=actions["traindoor"].down.length-1;an>=0;an--){
actions["traindoor"].down[an].reset(); actions["traindoor"].down[an].reset();
actions["traindoor"].down[an].time = 0; actions["traindoor"].down[an].time = 0;
@ -969,15 +968,15 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
function initstand(data) { function initstand(data) {
code = data.code; code = data.code;
if ( actions[code]) { if ( actions[code]) {
if (data.close == '1') { if (data.command == 'K') {
actions[code].status = '1'; actions[code].status = data.command;
actions[code].action.reset(); actions[code].action.reset();
actions[code].action.time = 0; actions[code].action.time = 0;
actions[code].action.timeScale = 1; actions[code].action.timeScale = 1;
actions[code].action.play(); actions[code].action.play();
} }
if (data.close == '0') { if (data.command == 'G') {
actions[code].status = '0'; actions[code].status = data.command;
actions[code].action.reset(); actions[code].action.reset();
actions[code].action.time = actions[code].action._clip.duration; actions[code].action.time = actions[code].action._clip.duration;
actions[code].action.timeScale = -1; actions[code].action.timeScale = -1;
@ -987,17 +986,17 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
} }
function standupdate(data) { function standupdate(data) {
code = data.code; code = data.code;
console.log(data);
if ( actions[code]) { if ( actions[code]) {
if (data.open == '1') { if (data.command == 'K') {
actions[code].status = '1'; actions[code].status = data.command;
actions[code].action.reset(); actions[code].action.reset();
actions[code].action.time = 0; actions[code].action.time = 0;
actions[code].action.timeScale = 1; actions[code].action.timeScale = 1;
actions[code].action.play(); actions[code].action.play();
} }
if (data.open == '0') { if (data.command == 'G') {
actions[code].status = '0'; actions[code].status = data.command;
actions[code].action.reset(); actions[code].action.reset();
actions[code].action.time = actions[code].action._clip.duration; actions[code].action.time = actions[code].action._clip.duration;
actions[code].action.timeScale = -1; actions[code].action.timeScale = -1;
@ -1008,72 +1007,107 @@ export function Jl3dDrivingNew(mixers,updatemmi,sound,translation,routegroup,dri
function signalupdate(data) { function signalupdate(data) {
code = data.code; code = data.code;
console.log(data); console.log(data);
if(data.red == 1){ if(data.command == 'No'){
signallist.list[code].mesh.getObjectByName("red").material.map = materials["red"];
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
}else{
signallist.list[code].mesh.getObjectByName("red").material.map = materials["black"]; signallist.list[code].mesh.getObjectByName("red").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true; signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
}
if(data.yellow == 1){
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["yellow"];
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
}else{
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["black"]; signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true; signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
}
if(data.green == 1){
signallist.list[code].mesh.getObjectByName("green").material.map = materials["green"];
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
}else{
signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"]; signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true; signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
}
/** 红 */
if(data.command == 'R'){
signallist.list[code].mesh.getObjectByName("red").material.map = materials["red"];
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
}
/** 绿 */
if(data.command == 'G'){
signallist.list[code].mesh.getObjectByName("red").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
signallist.list[code].mesh.getObjectByName("green").material.map = materials["green"];
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
}
/** 黄 */
if(data.command == 'Y'){
signallist.list[code].mesh.getObjectByName("red").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["yellow"];
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
}
/** 月白 */
if(data.command == 'W'){
signallist.list[code].mesh.getObjectByName("red").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
}
/** 蓝 */
if(data.command == 'B'){
signallist.list[code].mesh.getObjectByName("red").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
}
/** 红黄 */
if(data.command == 'RY'){
signallist.list[code].mesh.getObjectByName("red").material.map = materials["red"];
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["yellow"];
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
} }
} }
function initswitch(data) { function initswitch(data) {
code = data.code; code = data.code;
if (data.routeLock == '0') { if (data.command == 'NP') {
// sectionlist.switchs.modellist[j].normal = data.normal; // sectionlist.switchs.modellist[j].normal = data.normal;
actions[code].action.reset(); actions[code].action.reset();
actions[code].action.time = 0; actions[code].action.time = 0;
actions[code].action.timeScale = 1; actions[code].action.timeScale = 1;
actions[code].action.play(); actions[code].action.play();
actions[code].normal = "02"; actions[code].command = data.command;
} else if (data.routeLock == '1') { } else if (data.command == 'RP') {
// sectionlist.switchs.modellist[j].normal = data.normal; // sectionlist.switchs.modellist[j].normal = data.normal;
actions[code].action.reset(); actions[code].action.reset();
actions[code].action.time = actions[code].action._clip.duration; actions[code].action.time = actions[code].action._clip.duration;
actions[code].action.timeScale = -1; actions[code].action.timeScale = -1;
actions[code].action.play(); actions[code].action.play();
actions[code].normal = "01"; actions[code].command = data.command;
} }
} }
function switchupdate(data) { function switchupdate(data) {
code = data.code; code = data.code;
if (actions[code].normal != data.normal) { if (actions[code].command != data.command) {
if (data.normal == '02') { if (data.command == 'NP') {
// sectionlist.switchs.modellist[j].normal = data.normal; // sectionlist.switchs.modellist[j].normal = data.normal;
actions[code].action.reset(); actions[code].action.reset();
actions[code].action.time = 0; actions[code].action.time = 0;
actions[code].action.timeScale = 1; actions[code].action.timeScale = 1;
actions[code].action.play(); actions[code].action.play();
actions[code].normal = "02"; actions[code].command = data.command;
} else if (data.normal == '01') { } else if (data.command == 'RP') {
// sectionlist.switchs.modellist[j].normal = data.normal; // sectionlist.switchs.modellist[j].normal = data.normal;
actions[code].action.reset(); actions[code].action.reset();
actions[code].action.time = actions[code].action._clip.duration; actions[code].action.time = actions[code].action._clip.duration;
actions[code].action.timeScale = -1; actions[code].action.timeScale = -1;
actions[code].action.play(); actions[code].action.play();
actions[code].normal = "01"; actions[code].command = data.command;
} }
} }
} }

View File

@ -434,14 +434,14 @@ export function Jl3dfaultdevice(dom,group,token,skinCode) {
this.updateaction = function (data) { this.updateaction = function (data) {
if (data.type == "SWITCH") { if (data.type == "SWITCH") {
if (data.normal == "0") { if (data.command == 'NP') {
scope.modelmanager.switchmodel.normalPosition = "0"; scope.modelmanager.switchmodel.normalPosition = data.command;
scope.modelmanager.switchmodel.action.reset(); scope.modelmanager.switchmodel.action.reset();
scope.modelmanager.switchmodel.action.time = 0; scope.modelmanager.switchmodel.action.time = 0;
scope.modelmanager.switchmodel.action.timeScale = 1; scope.modelmanager.switchmodel.action.timeScale = 1;
scope.modelmanager.switchmodel.action.play(); scope.modelmanager.switchmodel.action.play();
} else if (data.normal == "1") { } else if (data.command == 'RP') {
scope.modelmanager.switchmodel.normalPosition = "1"; scope.modelmanager.switchmodel.normalPosition = data.command;
scope.modelmanager.switchmodel.action.reset(); scope.modelmanager.switchmodel.action.reset();
scope.modelmanager.switchmodel.action.time = scope.modelmanager.switchmodel.action._clip.duration; scope.modelmanager.switchmodel.action.time = scope.modelmanager.switchmodel.action._clip.duration;
scope.modelmanager.switchmodel.action.timeScale = -1; scope.modelmanager.switchmodel.action.timeScale = -1;
@ -450,34 +450,77 @@ export function Jl3dfaultdevice(dom,group,token,skinCode) {
} }
if (data.type == "SIGNAL") {//从上往下红绿黄 if (data.type == "SIGNAL") {//从上往下红绿黄
if(data.red == 1){
scope.modelmanager.signalmodel.mesh.children[0].material.map = scope.signallights["red"]; if(data.command == 'No'){
scope.modelmanager.signalmodel.mesh.children[0].material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.children[0].material.map.needsUpdate = true; scope.modelmanager.signalmodel.mesh.children[0].material.map.needsUpdate = true;
}else{ scope.modelmanager.signalmodel.mesh.children[2].material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.children[0].material.map = scope.signallights["black"];
scope.modelmanager.signalmodel.mesh.children[0].material.map.needsUpdate = true;
}
if(data.yellow == 1){
scope.modelmanager.signalmodel.mesh.children[2].material.map = scope.signallights["yellow"];
scope.modelmanager.signalmodel.mesh.children[2].material.map.needsUpdate = true; scope.modelmanager.signalmodel.mesh.children[2].material.map.needsUpdate = true;
}else{ scope.modelmanager.signalmodel.mesh.children[1].material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.children[2].material.map = scope.signallights["black"];
scope.modelmanager.signalmodel.mesh.children[2].material.map.needsUpdate = true;
}
if(data.green == 1){
scope.modelmanager.signalmodel.mesh.children[1].material.map = scope.signallights["green"];
scope.modelmanager.signalmodel.mesh.children[1].material.map.needsUpdate = true;
}else{
scope.modelmanager.signalmodel.mesh.children[1].material.map = scope.signallights["black"];
scope.modelmanager.signalmodel.mesh.children[1].material.map.needsUpdate = true; scope.modelmanager.signalmodel.mesh.children[1].material.map.needsUpdate = true;
} }
/** 红 */
if(data.command == 'R'){
scope.modelmanager.signalmodel.mesh.children[0].material.map = materials["red"];
scope.modelmanager.signalmodel.mesh.children[0].material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.children[2].material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.children[2].material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.children[1].material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.children[1].material.map.needsUpdate = true;
}
/** 绿 */
if(data.command == 'G'){
scope.modelmanager.signalmodel.mesh.children[0].material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.children[0].material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.children[2].material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.children[2].material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.children[1].material.map = materials["green"];
scope.modelmanager.signalmodel.mesh.children[1].material.map.needsUpdate = true;
}
/** 黄 */
if(data.command == 'Y'){
scope.modelmanager.signalmodel.mesh.children[0].material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.children[0].material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.children[2].material.map = materials["yellow"];
scope.modelmanager.signalmodel.mesh.children[2].material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.children[1].material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.children[1].material.map.needsUpdate = true;
}
/** 月白 */
if(data.command == 'W'){
scope.modelmanager.signalmodel.mesh.children[0].material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.children[0].material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.children[2].material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.children[2].material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.children[1].material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.children[1].material.map.needsUpdate = true;
}
/** 蓝 */
if(data.command == 'B'){
scope.modelmanager.signalmodel.mesh.children[0].material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.children[0].material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.children[2].material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.children[2].material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.children[1].material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.children[1].material.map.needsUpdate = true;
}
/** 红黄 */
if(data.command == 'RY'){
scope.modelmanager.signalmodel.mesh.children[0].material.map = materials["red"];
scope.modelmanager.signalmodel.mesh.children[0].material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.children[2].material.map = materials["yellow"];
scope.modelmanager.signalmodel.mesh.children[2].material.map.needsUpdate = true;
scope.modelmanager.signalmodel.mesh.children[1].material.map = materials["black"];
scope.modelmanager.signalmodel.mesh.children[1].material.map.needsUpdate = true;
}
} }
if (data.type == "PSD") { if (data.type == "PSD") {
if (data.code == scope.nowcode) { if (data.code == scope.nowcode) {
if (data.open == "1" ) { if (data.command == 'K' ) {
scope.modelmanager.standmodel.screenDoorOpenStatus = "0"; scope.modelmanager.standmodel.screenDoorOpenStatus = data.command;
scope.modelmanager.standmodel.action.reset(); scope.modelmanager.standmodel.action.reset();
scope.modelmanager.standmodel.action.time = 0; scope.modelmanager.standmodel.action.time = 0;
@ -485,8 +528,8 @@ export function Jl3dfaultdevice(dom,group,token,skinCode) {
scope.modelmanager.standmodel.action.play(); scope.modelmanager.standmodel.action.play();
} }
if (data.open == "0" ) { if (data.command == 'G' ) {
scope.modelmanager.standmodel.screenDoorOpenStatus = "1"; scope.modelmanager.standmodel.screenDoorOpenStatus = data.command;
scope.modelmanager.standmodel.action.reset(); scope.modelmanager.standmodel.action.reset();
scope.modelmanager.standmodel.action.time = scope.modelmanager.standmodel.action._clip.duration; scope.modelmanager.standmodel.action.time = scope.modelmanager.standmodel.action._clip.duration;

View File

@ -33,7 +33,7 @@ export function PassflowConnect(deviceaction,toptrain,downtrain,routegroup,passe
if(data.type == "DeviceCtrl_3D"){ if(data.type == "DeviceCtrl_3D"){
if(data.body.type == "PSD"){ if(data.body.type == "PSD"){
if(data.body.code == passerStation.nowStation.toppsd){ if(data.body.code == passerStation.nowStation.toppsd){
if(data.body.open == 0){ if(data.body.command == 'G'){
deviceaction.top.action.reset(); deviceaction.top.action.reset();
deviceaction.top.action.time =deviceaction.top.action._clip.duration; deviceaction.top.action.time =deviceaction.top.action._clip.duration;
@ -48,7 +48,7 @@ export function PassflowConnect(deviceaction,toptrain,downtrain,routegroup,passe
} }
} }
if(data.body.code == passerStation.nowStation.downpsd){ if(data.body.code == passerStation.nowStation.downpsd){
if(data.body.open == 0){ if(data.body.command == 'G'){
deviceaction.down.action.reset(); deviceaction.down.action.reset();
deviceaction.down.action.time = deviceaction.down.action._clip.duration; deviceaction.down.action.time = deviceaction.down.action._clip.duration;
deviceaction.down.action.timeScale = -1; deviceaction.down.action.timeScale = -1;
@ -64,24 +64,24 @@ export function PassflowConnect(deviceaction,toptrain,downtrain,routegroup,passe
} }
} }
if(data.body.type == "TRAIN_DOOR"){ if(data.body.type == "TRAIN_DOOR"){
if(toptrain.nowcode == data.body.code){ if(toptrain.nowcode == data.body.trainCode){
if(data.body.open == "0"){ if(data.body.command == 'G'){
closetraindoor(toptrain,data.body.doorCode,"top"); closetraindoor(toptrain,data.body.code,"top");
}else{ }else{
opentraindoor(toptrain,data.body.doorCode,"top"); opentraindoor(toptrain,data.body.code,"top");
} }
} }
if(downtrain.nowcode == data.body.code){ if(downtrain.nowcode == data.body.trainCode){
// console.log(data.body); // console.log(data.body);
if(data.body.open == "0"){ if(data.body.command == 'G'){
closetraindoor(downtrain,data.body.doorCode,"down"); closetraindoor(downtrain,data.body.code,"down");
}else{ }else{
opentraindoor(downtrain,data.body.doorCode,"down"); opentraindoor(downtrain,data.body.code,"down");
} }

View File

@ -165,7 +165,6 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
function trainRunNew(data){ function trainRunNew(data){
let code = data.code; let code = data.code;
if(trainlisttest.list[code].right != data.right){ if(trainlisttest.list[code].right != data.right){
if(data.right == "0"){ if(data.right == "0"){
@ -609,20 +608,20 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
} }
function traindoorupdate(data){ function traindoorupdate(data){
let code = data.code; let code = data.trainCode;
if(trainlisttest.list[code].right == "0"){ if(trainlisttest.list[code].right == "0"){
if(data.doorCode == "2"){ if(data.code == "2"){
if(trainlisttest.list[code].openleft != data.open && data.open == "0"){ if(trainlisttest.list[code].openleft != data.command && data.command == "G"){
trainlisttest.list[code].openleft = "0"; trainlisttest.list[code].openleft = data.command;
for(let an=actions[code].top.length-1;an>=0;an--){ for(let an=actions[code].top.length-1;an>=0;an--){
actions[code].top[an].reset(); actions[code].top[an].reset();
actions[code].top[an].time = actions[code].top[an]._clip.duration; actions[code].top[an].time = actions[code].top[an]._clip.duration;
actions[code].top[an].timeScale = -1; actions[code].top[an].timeScale = -1;
actions[code].top[an].play(); actions[code].top[an].play();
} }
}else if(trainlisttest.list[code].openleft != data.open && data.open == "1"){ }else if(trainlisttest.list[code].openleft != data.command && data.command == "K"){
trainlisttest.list[code].openleft = "1"; trainlisttest.list[code].openleft = data.command;
for(let an=actions[code].top.length-1;an>=0;an--){ for(let an=actions[code].top.length-1;an>=0;an--){
actions[code].top[an].reset(); actions[code].top[an].reset();
actions[code].top[an].time = 0; actions[code].top[an].time = 0;
@ -633,16 +632,16 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
}else{ }else{
if (trainlisttest.list[code].openright != data.open && data.open == '0') { if (trainlisttest.list[code].openright != data.command && data.command == 'G') {
trainlisttest.list[code].openright = '0'; trainlisttest.list[code].openright = data.command;
for (let an=actions[code].down.length-1; an>=0; an--) { for (let an=actions[code].down.length-1; an>=0; an--) {
actions[code].down[an].reset(); actions[code].down[an].reset();
actions[code].down[an].time = actions[code].down[an]._clip.duration; actions[code].down[an].time = actions[code].down[an]._clip.duration;
actions[code].down[an].timeScale = -1; actions[code].down[an].timeScale = -1;
actions[code].down[an].play(); actions[code].down[an].play();
} }
} else if (trainlisttest.list[code].openright != data.open && data.open == '1') { } else if (trainlisttest.list[code].openright != data.command && data.command == 'K') {
trainlisttest.list[code].openright = "1"; trainlisttest.list[code].openright = data.command;
for(let an=actions[code].down.length-1;an>=0;an--){ for(let an=actions[code].down.length-1;an>=0;an--){
actions[code].down[an].reset(); actions[code].down[an].reset();
actions[code].down[an].time = 0; actions[code].down[an].time = 0;
@ -653,18 +652,18 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
} }
}else{ }else{
if(data.doorCode == "1"){ if(data.code == "1"){
if(trainlisttest.list[code].openleft != data.open && data.open == "0"){ if(trainlisttest.list[code].openleft != data.command && data.command == "G"){
trainlisttest.list[code].openleft = "0"; trainlisttest.list[code].openleft = data.command;
for(let an=actions[code].top.length-1;an>=0;an--){ for(let an=actions[code].top.length-1;an>=0;an--){
actions[code].top[an].reset(); actions[code].top[an].reset();
actions[code].top[an].time = actions[code].top[an]._clip.duration; actions[code].top[an].time = actions[code].top[an]._clip.duration;
actions[code].top[an].timeScale = -1; actions[code].top[an].timeScale = -1;
actions[code].top[an].play(); actions[code].top[an].play();
} }
}else if(trainlisttest.list[code].openleft != data.open && data.open == "1"){ }else if(trainlisttest.list[code].openleft != data.command && data.command == "K"){
trainlisttest.list[code].openleft = "1"; trainlisttest.list[code].openleft = data.command;
for(let an=actions[code].top.length-1;an>=0;an--){ for(let an=actions[code].top.length-1;an>=0;an--){
actions[code].top[an].reset(); actions[code].top[an].reset();
actions[code].top[an].time = 0; actions[code].top[an].time = 0;
@ -675,16 +674,16 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
}else{ }else{
if (trainlisttest.list[code].openright != data.open && data.open == '0') { if (trainlisttest.list[code].openright != data.command && data.command == 'G') {
trainlisttest.list[code].openright = '0'; trainlisttest.list[code].openright = data.command;
for (let an=actions[code].down.length-1; an>=0; an--) { for (let an=actions[code].down.length-1; an>=0; an--) {
actions[code].down[an].reset(); actions[code].down[an].reset();
actions[code].down[an].time = actions[code].down[an]._clip.duration; actions[code].down[an].time = actions[code].down[an]._clip.duration;
actions[code].down[an].timeScale = -1; actions[code].down[an].timeScale = -1;
actions[code].down[an].play(); actions[code].down[an].play();
} }
} else if (trainlisttest.list[code].openright != data.open && data.open == '1') { } else if (trainlisttest.list[code].openright != data.command && data.command == 'K') {
trainlisttest.list[code].openright = "1"; trainlisttest.list[code].openright = data.command;
for(let an=actions[code].down.length-1;an>=0;an--){ for(let an=actions[code].down.length-1;an>=0;an--){
actions[code].down[an].reset(); actions[code].down[an].reset();
actions[code].down[an].time = 0; actions[code].down[an].time = 0;
@ -696,6 +695,8 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
} }
} }
} }
function trainstatus(data){ function trainstatus(data){
@ -758,15 +759,15 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
function initstand(data) { function initstand(data) {
code = data.code; code = data.code;
if ( actions[code]) { if ( actions[code]) {
if (data.close == '1') { if (data.command == 'K') {
actions[code].status = '1'; actions[code].status = data.command;
actions[code].action.reset(); actions[code].action.reset();
actions[code].action.time = 0; actions[code].action.time = 0;
actions[code].action.timeScale = 1; actions[code].action.timeScale = 1;
actions[code].action.play(); actions[code].action.play();
} }
if (data.close == '0') { if (data.command == 'G') {
actions[code].status = '0'; actions[code].status = data.command;
actions[code].action.reset(); actions[code].action.reset();
actions[code].action.time = actions[code].action._clip.duration; actions[code].action.time = actions[code].action._clip.duration;
actions[code].action.timeScale = -1; actions[code].action.timeScale = -1;
@ -776,17 +777,16 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
} }
function standupdate(data) { function standupdate(data) {
code = data.code; code = data.code;
if ( actions[code]) { if ( actions[code]) {
if (data.open == '1') { if (data.command == 'K') {
actions[code].status = '1'; actions[code].status = data.command;
actions[code].action.reset(); actions[code].action.reset();
actions[code].action.time = 0; actions[code].action.time = 0;
actions[code].action.timeScale = 1; actions[code].action.timeScale = 1;
actions[code].action.play(); actions[code].action.play();
} }
if (data.open == '0') { if (data.command == 'G') {
actions[code].status = '0'; actions[code].status = data.command;
actions[code].action.reset(); actions[code].action.reset();
actions[code].action.time = actions[code].action._clip.duration; actions[code].action.time = actions[code].action._clip.duration;
actions[code].action.timeScale = -1; actions[code].action.timeScale = -1;
@ -797,33 +797,70 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
function signalupdate(data) { function signalupdate(data) {
code = data.code; code = data.code;
if(signallist.list[code]){ if(signallist.list[code]){
if(data.red == 1){ /** 无显示,灭灯 */
signallist.list[code].mesh.getObjectByName("red").material.map = materials["red"]; if(data.command == 'No'){
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
}else{
signallist.list[code].mesh.getObjectByName("red").material.map = materials["black"]; signallist.list[code].mesh.getObjectByName("red").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true; signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
}
if(data.yellow == 1){
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["yellow"];
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
}else{
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["black"]; signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true; signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
}
if(data.green == 1){
signallist.list[code].mesh.getObjectByName("green").material.map = materials["green"];
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
}else{
signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"]; signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true; signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
} }
/** 红 */
if(data.command == 'R'){
signallist.list[code].mesh.getObjectByName("red").material.map = materials["red"];
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
}
/** 绿 */
if(data.command == 'G'){
signallist.list[code].mesh.getObjectByName("red").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
signallist.list[code].mesh.getObjectByName("green").material.map = materials["green"];
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
}
/** 黄 */
if(data.command == 'Y'){
signallist.list[code].mesh.getObjectByName("red").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["yellow"];
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
}
/** 月白 */
if(data.command == 'W'){
signallist.list[code].mesh.getObjectByName("red").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
}
/** 蓝 */
if(data.command == 'B'){
signallist.list[code].mesh.getObjectByName("red").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
}
/** 红黄 */
if(data.command == 'RY'){
signallist.list[code].mesh.getObjectByName("red").material.map = materials["red"];
signallist.list[code].mesh.getObjectByName("red").material.map.needsUpdate = true;
signallist.list[code].mesh.getObjectByName("yellow").material.map = materials["yellow"];
signallist.list[code].mesh.getObjectByName("yellow").material.map.needsUpdate = true;
signallist.list[code].mesh.getObjectByName("green").material.map = materials["black"];
signallist.list[code].mesh.getObjectByName("green").material.map.needsUpdate = true;
}
} }
@ -831,40 +868,40 @@ export function Jlmap3dSubscribeNew(jlmap3d,routegroup,jsonwebwork) {
function initswitch(data) { function initswitch(data) {
code = data.code; code = data.code;
if (data.routeLock == '0') { if (data.command == 'NP') {
// sectionlist.switchs.modellist[j].normal = data.normal; // sectionlist.switchs.modellist[j].normal = data.normal;
actions[code].action.reset(); actions[code].action.reset();
actions[code].action.time = 0; actions[code].action.time = 0;
actions[code].action.timeScale = 1; actions[code].action.timeScale = 1;
actions[code].action.play(); actions[code].action.play();
actions[code].normal = "02"; actions[code].command = data.command;
} else if (data.routeLock == '1') { } else if (data.command == 'RP') {
// sectionlist.switchs.modellist[j].normal = data.normal; // sectionlist.switchs.modellist[j].normal = data.normal;
actions[code].action.reset(); actions[code].action.reset();
actions[code].action.time = actions[code].action._clip.duration; actions[code].action.time = actions[code].action._clip.duration;
actions[code].action.timeScale = -1; actions[code].action.timeScale = -1;
actions[code].action.play(); actions[code].action.play();
actions[code].normal = "01"; actions[code].command = data.command;
} }
} }
function switchupdate(data) { function switchupdate(data) {
code = data.code; code = data.code;
if (actions[code].normal != data.normal) { if (actions[code].command != data.command) {
if (data.normal == '1') { if (data.command == 'NP') {
// sectionlist.switchs.modellist[j].normal = data.normal; // sectionlist.switchs.modellist[j].normal = data.normal;
actions[code].action.reset(); actions[code].action.reset();
actions[code].action.time = 0; actions[code].action.time = 0;
actions[code].action.timeScale = 1; actions[code].action.timeScale = 1;
actions[code].action.play(); actions[code].action.play();
actions[code].normal = "1"; actions[code].command = data.command;
} else if (data.normal == '0') { } else if (data.command == 'RP') {
// sectionlist.switchs.modellist[j].normal = data.normal; // sectionlist.switchs.modellist[j].normal = data.normal;
actions[code].action.reset(); actions[code].action.reset();
actions[code].action.time = actions[code].action._clip.duration; actions[code].action.time = actions[code].action._clip.duration;
actions[code].action.timeScale = -1; actions[code].action.timeScale = -1;
actions[code].action.play(); actions[code].action.play();
actions[code].normal = "0"; actions[code].command = data.command;
} }
} }
} }

View File

@ -60,6 +60,7 @@ let passerWebWork = new Worker(JL3D_LOCAL_STATIC+"/workertest/trafficplan/traffi
//老版本临时ai控制 //老版本临时ai控制
let olddataai = false; let olddataai = false;
//北交大车站管理
export function Jl3dStationManager(dom,skinCode,routegroup,initCode) { export function Jl3dStationManager(dom,skinCode,routegroup,initCode) {
// let stats = new Stats(); // let stats = new Stats();

View File

@ -60,6 +60,8 @@ let passerWebWork = new Worker(JL3D_LOCAL_STATIC+"/workertest/passsimulation/sta
//老版本临时ai控制 //老版本临时ai控制
let olddataai = false; let olddataai = false;
//北交大列车管理
export function Jl3dTrafficTrain(dom,skinCode,routegroup,viewMap,initCode) { export function Jl3dTrafficTrain(dom,skinCode,routegroup,viewMap,initCode) {
// let stats = new Stats(); // let stats = new Stats();

View File

@ -52,6 +52,7 @@ export function SwitchListN() {
let mixer = new THREE.AnimationMixer( autoswitch ); let mixer = new THREE.AnimationMixer( autoswitch );
actions[autoswitch.code] = { actions[autoswitch.code] = {
normal:"00", normal:"00",
command:"",
action:mixer.clipAction( autoswitch.animations[0]) action:mixer.clipAction( autoswitch.animations[0])
}; };
actions[autoswitch.code].action.setLoop(THREE.LoopOnce); actions[autoswitch.code].action.setLoop(THREE.LoopOnce);

View File

@ -311,7 +311,7 @@ class Jlmap {
const showMode = prdType2ShowMode[this.showConfig.prdType]; const showMode = prdType2ShowMode[this.showConfig.prdType];
this.updateShowMode(list, showMode); this.updateShowMode(list, showMode);
this.updateShowStation(list); // this.updateShowStation(list);
if (this.methods.viewUpdate instanceof Function) { this.methods.viewUpdate(list); } if (this.methods.viewUpdate instanceof Function) { this.methods.viewUpdate(list); }
} }

View File

@ -18,7 +18,7 @@ export default class AutoTurnBack extends Group {
this.zlevel = model.zlevel; this.zlevel = model.zlevel;
this.model = model; this.model = model;
this.style = style; this.style = style;
// this.isShowShape = true; this.isBigScreen = false;
this.create(); this.create();
this.createMouseEvent(); this.createMouseEvent();
this.setState(model); this.setState(model);
@ -106,6 +106,7 @@ export default class AutoTurnBack extends Group {
this.subtitleText && this.subtitleText.show(); this.subtitleText && this.subtitleText.show();
this.arcBorder && this.arcBorder.show(); this.arcBorder && this.arcBorder.show();
this.control && this.control.setStyle({ fill: this.style.AutoTurnBack.lamp.controlColor }); this.control && this.control.setStyle({ fill: this.style.AutoTurnBack.lamp.controlColor });
if (this.isBigScreen) { this.screenShow(); }
} }
handleSignal() { handleSignal() {
this.control.setStyle({ fill: this.style.AutoTurnBack.lamp.lightUpColor }); this.control.setStyle({ fill: this.style.AutoTurnBack.lamp.lightUpColor });
@ -195,6 +196,7 @@ export default class AutoTurnBack extends Group {
} }
} }
screenShow() { screenShow() {
this.isBigScreen = true;
this.hideMode(); this.hideMode();
} }
getAnchorPoint() { getAnchorPoint() {

View File

@ -10,7 +10,7 @@ export default class OutFrame extends Group {
this._code = model.code; this._code = model.code;
this.style = style; this.style = style;
this.zlevel = model.zlevel; this.zlevel = model.zlevel;
this.isShowShape = true; this.isBigScreen = false;
this.z = 0; this.z = 0;
this.create(); this.create();
this.setState(model); this.setState(model);
@ -48,6 +48,7 @@ export default class OutFrame extends Group {
} }
recover() { recover() {
this.box && this.box.show(); this.box && this.box.show();
if (this.isBigScreen) { this.screenShow(); }
} }
// 设置显示模式 // 设置显示模式
setShowMode() { setShowMode() {
@ -65,6 +66,7 @@ export default class OutFrame extends Group {
// } // }
} }
screenShow() { screenShow() {
this.isBigScreen = true;
this.box && this.box.hide(); this.box && this.box.hide();
} }
getAnchorPoint() { getAnchorPoint() {

View File

@ -13,7 +13,7 @@ export default class Line2 extends Group {
this.z = 0; this.z = 0;
this.model = model; this.model = model;
this.style = style; this.style = style;
this.isShowShape = true; this.isBigScreen = false;
this.create(); this.create();
this.createTerminal(); this.createTerminal();
this.setState(model); this.setState(model);
@ -128,6 +128,7 @@ export default class Line2 extends Group {
this.line && this.line.setStyle('stroke', this.style.Power.noElectricStrokeColor); this.line && this.line.setStyle('stroke', this.style.Power.noElectricStrokeColor);
this.leftTerminal && this.leftTerminal.show(); this.leftTerminal && this.leftTerminal.show();
this.rightTerminal && this.rightTerminal.show(); this.rightTerminal && this.rightTerminal.show();
if (this.isBigScreen) { this.screenShow(); }
} }
// 设置显示模式 // 设置显示模式
@ -145,6 +146,7 @@ export default class Line2 extends Group {
// } // }
} }
screenShow() { screenShow() {
this.isBigScreen = true;
this.eachChild((child) => { this.eachChild((child) => {
child.hide(); child.hide();
}); });

View File

@ -51,7 +51,8 @@ class EHorizontal2Door extends Group {
} }
recover() { recover() {
this.stand1 && this.stand1.show();
this.stand2 && this.stand2.show();
} }
setState(model) { setState(model) {

View File

@ -34,6 +34,7 @@ class ERect2Door extends Group {
recover() { recover() {
const style = this.model.style; const style = this.model.style;
this.psd.setStyle('fill', style.Psd.rectDoor.defaultColor); this.psd.setStyle('fill', style.Psd.rectDoor.defaultColor);
this.psd && this.psd.show();
} }
setState(model) { setState(model) {

View File

@ -59,6 +59,8 @@ class ESafeDoor extends Group {
recover() { recover() {
const style = this.model.style; const style = this.model.style;
this.setColor(style.Psd.safetyDoorNormal.defaultColor); this.setColor(style.Psd.safetyDoorNormal.defaultColor);
this.safeL && this.safeL.show();
this.safeC && this.safeC.hide();
} }
setColor(color) { setColor(color) {

View File

@ -62,6 +62,8 @@ class EVertical2Door extends Group {
recover() { recover() {
// const style = this.model.style; // const style = this.model.style;
// this.setColor(style.Psd.vertical2Door.defaultColor); // this.setColor(style.Psd.vertical2Door.defaultColor);
this.safeB && this.safeB.show();
this.safeT && this.safeT.show();
} }
setColor(color) { setColor(color) {

View File

@ -42,6 +42,7 @@ export default class Line2 extends Group {
recover() { recover() {
const currentTypeList = this.style.Psd.elemnetType; const currentTypeList = this.style.Psd.elemnetType;
currentTypeList.forEach(element => { currentTypeList.forEach(element => {
this[element].show();
this[element].recover(); this[element].recover();
}); });
} }

View File

@ -150,6 +150,7 @@ export default class Section extends Group {
this.derailer && this.derailer.hide(); this.derailer && this.derailer.hide();
this.speedLimit && this.speedLimit.hide(); this.speedLimit && this.speedLimit.hide();
this.speedLimitName && this.speedLimitName.hide(); this.speedLimitName && this.speedLimitName.hide();
this.separator && this.separator.show();
this.badShunt && this.badShunt.hide(); this.badShunt && this.badShunt.hide();
this.axle && this.axle.setStyle({ this.axle && this.axle.setStyle({

View File

@ -12,6 +12,7 @@ export default class SplitStation extends Group {
this._type = model._type; this._type = model._type;
this.zlevel = model.zlevel; this.zlevel = model.zlevel;
this.model = model; this.model = model;
this.isBigScreen = false;
this.style = style; this.style = style;
this.create(); this.create();
} }
@ -150,8 +151,10 @@ export default class SplitStation extends Group {
this.arrowRight && this.arrowRight.show(); this.arrowRight && this.arrowRight.show();
this.leftText && this.leftText.show(); this.leftText && this.leftText.show();
this.rightText && this.rightText.show(); this.rightText && this.rightText.show();
if (this.isBigScreen) { this.screenShow(); }
} }
screenShow() { screenShow() {
this.isBigScreen = true;
this.eachChild((child) => { this.eachChild((child) => {
child.hide(); child.hide();
}); });

View File

@ -33,7 +33,6 @@ export default class Station extends Group {
this.createControlMode(); this.createControlMode();
this.setState(model); this.setState(model);
this.checkIsDrawMap(); this.checkIsDrawMap();
this.setVisible(model.visible);
this.setShowMode(); this.setShowMode();
} }
@ -76,10 +75,7 @@ export default class Station extends Group {
textFill: model.kmPostFontColor textFill: model.kmPostFontColor
}); });
this.add(this.mileageText); this.add(this.mileageText);
model.kmPostShow ? this.mileageText.show() : this.mileageText.hide();
if (!model.visible) {
this.mileageText.setStyle('fontSize', 0);
}
} }
// if (!model.visible) { // 隐藏车站 // if (!model.visible) { // 隐藏车站
@ -596,6 +592,7 @@ export default class Station extends Group {
// 设置状态 // 设置状态
setState(model) { setState(model) {
this.recover(); this.recover();
this.setVisible();
if (!store.getters['map/checkDeviceShow'](this._code)) { if (!store.getters['map/checkDeviceShow'](this._code)) {
this.eachChild(item => { item.hide(); }); this.eachChild(item => { item.hide(); });
} else { } else {
@ -641,9 +638,6 @@ export default class Station extends Group {
} }
}); });
} }
if (this.mileageText) {
model.kmPostShow ? this.mileageText.show() : this.mileageText.hide();
}
} }
} }
handlePreResetLamp() { handlePreResetLamp() {
@ -789,12 +783,18 @@ export default class Station extends Group {
} }
} }
setVisible(visible) { setVisible() {
if (visible) { if (this.model.visible) {
this.eachChild(elem => { elem.show(); }); this.eachChild(elem => { elem.show(); });
} else { } else {
this.eachChild(elem => { elem.hide(); }); this.eachChild(elem => { elem.hide(); });
} }
if (this.mileageText) {
this.model.kmPostShow ? this.mileageText.show() : this.mileageText.hide();
}
if (!this.model.visible) {
this.mileageText && this.mileageText.hide();
}
} }
getAnchorPoint() { getAnchorPoint() {
return this.model.position; return this.model.position;

View File

@ -145,6 +145,7 @@ class StationStand extends Group {
recover() { recover() {
const currentTypeList = this.style.StationStand.elemnetType; const currentTypeList = this.style.StationStand.elemnetType;
currentTypeList.forEach(element => { currentTypeList.forEach(element => {
this[element].show();
this[element].recover(); this[element].recover();
}); });
this.stopJumpLamp && this.stopJumpLamp.hide(); this.stopJumpLamp && this.stopJumpLamp.hide();

View File

@ -90,6 +90,8 @@ class ESolidStand extends Group {
this.setColor(style.StationStand.solidStand.spareColor); this.setColor(style.StationStand.solidStand.spareColor);
this.holdTrain && this.holdTrain.setStyle('fill', style.StationStand.solidStand.spareColor); this.holdTrain && this.holdTrain.setStyle('fill', style.StationStand.solidStand.spareColor);
this.holdTrain && this.holdTrain.hide(); this.holdTrain && this.holdTrain.hide();
this.arrowText && this.arrowText.hide();
this.stand && this.stand.show();
} }
setHoldTrain(type) { setHoldTrain(type) {

View File

@ -13,6 +13,7 @@ export default class Text2 extends Group {
this.model = model; this.model = model;
this.style = style; this.style = style;
this.z = 6; this.z = 6;
this.isBigScreen = false;
this.lineCode = lineCode; this.lineCode = lineCode;
this.create(); this.create();
this.setState(model); this.setState(model);
@ -52,6 +53,7 @@ export default class Text2 extends Group {
} }
recover() { recover() {
this.text && this.text.show(); this.text && this.text.show();
if (this.isBigScreen) { this.screenShow(); }
} }
getBoundingRect() { getBoundingRect() {
if (this.text) { if (this.text) {
@ -78,6 +80,7 @@ export default class Text2 extends Group {
// } // }
} }
screenShow() { screenShow() {
this.isBigScreen = true;
if (this.lineCode == '06') { // 宁波线路隐藏 if (this.lineCode == '06') { // 宁波线路隐藏
this.text && this.text.hide(); this.text && this.text.hide();
} else { } else {

View File

@ -13,7 +13,7 @@ export default class Text2 extends Group {
this.style = style; this.style = style;
this.z = 6; this.z = 6;
this.lineCode = lineCode; this.lineCode = lineCode;
this.isShowShape = true; this.isBigScreen = false;
this.create(); this.create();
this.setState(model); this.setState(model);
this.setShowMode(); this.setShowMode();
@ -45,7 +45,7 @@ export default class Text2 extends Group {
} }
setState(model) { setState(model) {
if (!this.isShowShape) return; if (this.isBigScreen) { this.screenShow(); }
} }
getBoundingRect() { getBoundingRect() {
if (this.text) { if (this.text) {
@ -83,6 +83,7 @@ export default class Text2 extends Group {
} }
} }
screenShow() { screenShow() {
this.isBigScreen = true;
if (this.lineCode == '06') { // 宁波线路隐藏 if (this.lineCode == '06') { // 宁波线路隐藏
this.text && this.text.hide(); this.text && this.text.hide();
} else { } else {

View File

@ -21,6 +21,7 @@ import Link_Bxkc from '@/assets/icon/link_bxkc.png';
import Link_Crsc from '@/assets/icon/link_crsc.png'; import Link_Crsc from '@/assets/icon/link_crsc.png';
import Link_Hls from '@/assets/icon/link_hls.png'; import Link_Hls from '@/assets/icon/link_hls.png';
import Link_Bjd from '@/assets/icon/link_bjd.png'; import Link_Bjd from '@/assets/icon/link_bjd.png';
import TransparentIcon from '@/assets/icon/transparent.png';
// title:页面title; loginPath:退出登录跳转路径; loginParam:登录接口参数project;loginTitle:登录页左上角titlelogoWidth登录页左上角logo宽度 // title:页面title; loginPath:退出登录跳转路径; loginParam:登录接口参数project;loginTitle:登录页左上角titlelogoWidth登录页左上角logo宽度
// homeTitle:导航栏title(没有采用title); browserTitle:浏览器窗口titlebottomColumn底部栏描述bottomIcon底部栏Icon;linkIcon:浏览器窗口icon(没有采用ProjectIcon) // homeTitle:导航栏title(没有采用title); browserTitle:浏览器窗口titlebottomColumn底部栏描述bottomIcon底部栏Icon;linkIcon:浏览器窗口icon(没有采用ProjectIcon)
@ -480,6 +481,24 @@ export const loginInfo = {
navigationLogoWidth: '40px', navigationLogoWidth: '40px',
navigationMarginLeft: '50px', navigationMarginLeft: '50px',
systemType: '023' systemType: '023'
},
nologo: {
title: '城市轨道交通实训平台',
loginPath: '/login?project=nologo',
loginParam: 'NOLOGO',
bottomColumn: '',
navigationLogoWidth: '10px',
navigationMarginLeft: '10px',
systemType: '011'
},
designnologo: {
title: '城市轨道交通设计平台',
loginPath: '/design/login?project=nologo',
loginParam: 'NOLOGO',
bottomColumn: '',
navigationLogoWidth: '10px',
navigationMarginLeft: '10px',
systemType: '011'
} }
}; };
@ -526,7 +545,9 @@ export const ProjectIcon = {
richor:FaviconRichor, richor:FaviconRichor,
richorlesson3d:FaviconRichor, richorlesson3d:FaviconRichor,
richorjoint: FaviconRichor, richorjoint: FaviconRichor,
designrichorjoint: FaviconRichor designrichorjoint: FaviconRichor,
nologo: TransparentIcon,
designnologo: TransparentIcon
}; };
export const ProjectCode = { export const ProjectCode = {
@ -560,13 +581,15 @@ export const ProjectCode = {
richor:'RICHOR', richor:'RICHOR',
richorlesson3d:'RICHOR', richorlesson3d:'RICHOR',
richorjoint: 'RICHOR_JOINT', richorjoint: 'RICHOR_JOINT',
designrichorjoint: 'RICHOR_JOINT' designrichorjoint: 'RICHOR_JOINT',
nologo: 'NOLOGO',
designnologo: 'NOLOGO'
}; };
export const BottomColumnOnlyConInfo = ['heb', 'designheb', 'jyd', 'designjyd', 'tky', 'designtky', 'bxkc', 'designbxkc', 'crsc', 'designcrsc', 'hls', 'designhls', 'hyd', 'designhyd', 'cgy', 'designcgy', 'richor', 'richorlesson3d', 'richorjoint', 'designrichorjoint']; // 底部栏仅展示公司信息不展示备案号 export const BottomColumnOnlyConInfo = ['heb', 'designheb', 'jyd', 'designjyd', 'tky', 'designtky', 'bxkc', 'designbxkc', 'crsc', 'designcrsc', 'hls', 'designhls', 'hyd', 'designhyd', 'cgy', 'designcgy', 'richor', 'richorlesson3d', 'richorjoint', 'designrichorjoint', 'nologo', 'designnologo']; // 底部栏仅展示公司信息不展示备案号
export const GetMapListByProjectList = ['xty', 'designxty', 'gzb', 'designgzb', 'xadt', 'designxadt', 'heb', 'designheb', 'designdrts', 'drts', 'wjls', 'nty', 'designnty', 'sdy', 'designsdy', 'ntyc', 'designntyc', 'ntyl', 'designntyl', 'designbjd', 'cgy', 'designcgy', 'zzww', 'zzwwtest', 'richor','richorlesson3d', 'richorjoint', 'designrichorjoint']; // 实训设计平台通过项目code获取地图列表的项目 export const GetMapListByProjectList = ['xty', 'designxty', 'gzb', 'designgzb', 'xadt', 'designxadt', 'heb', 'designheb', 'designdrts', 'drts', 'wjls', 'nty', 'designnty', 'sdy', 'designsdy', 'ntyc', 'designntyc', 'ntyl', 'designntyl', 'designbjd', 'cgy', 'designcgy', 'zzww', 'zzwwtest', 'richor', 'richorlesson3d', 'richorjoint', 'designrichorjoint', 'nologo', 'designnologo']; // 实训设计平台通过项目code获取地图列表的项目
export const CaseHideProjectList = ['heb', 'designheb', 'cgy', 'designcgy']; // 案例展示隐藏的项目 export const CaseHideProjectList = ['heb', 'designheb', 'cgy', 'designcgy']; // 案例展示隐藏的项目
export const VersionBaseNoShow = ['heb', 'designheb', 'hls', 'designhls', 'drts', 'wjls', 'hyd', 'designhyd', 'cgy', 'designcgy', 'xadt', 'designxadt']; // 登录页右下角版本开发基于不展示 export const VersionBaseNoShow = ['heb', 'designheb', 'hls', 'designhls', 'drts', 'wjls', 'hyd', 'designhyd', 'cgy', 'designcgy', 'xadt', 'designxadt', 'nologo', 'designnologo']; // 登录页右下角版本开发基于不展示
export const MainBodyNoShow = ['heb', 'designheb', 'jyd', 'designjyd', 'tky', 'designtky', 'bxkc', 'designbxkc', 'crsc', 'designcrsc', 'hls', 'designhls', 'hyd', 'designhyd', 'cgy', 'designcgy', 'xadt', 'designxadt','richor','richorlesson3d', 'richorjoint']; // 登录页右下角主体不展示 export const MainBodyNoShow = ['heb', 'designheb', 'jyd', 'designjyd', 'tky', 'designtky', 'bxkc', 'designbxkc', 'crsc', 'designcrsc', 'hls', 'designhls', 'hyd', 'designhyd', 'cgy', 'designcgy', 'xadt', 'designxadt', 'richor', 'richorlesson3d', 'richorjoint', 'nologo', 'designnologo']; // 登录页右下角主体不展示
export const ProjectLoginStyleList = ['gzb', 'designgzb', 'xty', 'designxty', 'xadt', 'designxadt', 'tky', 'designtky', 'jyd', 'designjyd', 'bxkc', 'designbxkc', export const ProjectLoginStyleList = ['gzb', 'designgzb', 'xty', 'designxty', 'xadt', 'designxadt', 'tky', 'designtky', 'jyd', 'designjyd', 'bxkc', 'designbxkc',
'crsc', 'designcrsc', 'hls', 'designhls', 'drts', 'wjls', 'hyd', 'designhyd', 'nty', 'designnty', 'bjd', 'designbjd', 'sdy', 'designsdy', 'ntyc', 'designntyc', 'ntyl', 'designntyl', 'cgy', 'designcgy', 'zzww', 'zzwwtest']; // 登录页样式 'crsc', 'designcrsc', 'hls', 'designhls', 'drts', 'wjls', 'hyd', 'designhyd', 'nty', 'designnty', 'bjd', 'designbjd', 'sdy', 'designsdy', 'ntyc', 'designntyc', 'ntyl', 'designntyl', 'cgy', 'designcgy', 'zzww', 'zzwwtest']; // 登录页样式
export const NoQrcodeList = ['heb', 'designheb', 'cgy', 'designcgy', 'ntyl', 'designntyl']; export const NoQrcodeList = ['heb', 'designheb', 'cgy', 'designcgy', 'ntyl', 'designntyl'];
@ -608,7 +631,9 @@ export const goOtherPlatformMenu = { // 导航栏快速切换平台
// cgy: '/design/login?project=cgy', // cgy: '/design/login?project=cgy',
// designcgy: '/login?project=cgy' // designcgy: '/login?project=cgy'
richorjoint: '/design/login?project=richorjoint', richorjoint: '/design/login?project=richorjoint',
designrichorjoint: '/login?project=richorjoint' designrichorjoint: '/login?project=richorjoint',
nologo: '/design/login?project=nologo',
designnologo: '/login?project=nologo'
}; };
export const ProjectList = [ export const ProjectList = [
{value:'xty', label:'西铁院'}, {value:'xty', label:'西铁院'},
@ -628,7 +653,8 @@ export const ProjectList = [
{value: 'zzwwtest', label: '郑州共赢考试'}, {value: 'zzwwtest', label: '郑州共赢考试'},
{value: 'richor', label: '中航锐创'}, {value: 'richor', label: '中航锐创'},
{value: 'richorlesson3d', label: '中航锐创(三维课程)'}, {value: 'richorlesson3d', label: '中航锐创(三维课程)'},
{value: 'richor_joint', label: '中航锐创(实训室)'} {value: 'richor_joint', label: '中航锐创(实训室)'},
{value: 'nologo', label: '无logo' }
]; ];
export const localPackageProject = { export const localPackageProject = {
localdesign: 'designheb', localdesign: 'designheb',

File diff suppressed because it is too large Load Diff

View File

@ -2,9 +2,10 @@ export function getBaseUrl() {
let BASE_API; let BASE_API;
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud'; // BASE_API = 'https://joylink.club/jlcloud';
BASE_API = 'https://test.joylink.club/jlcloud'; // BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.8.152:9000'; // 袁琪 // BASE_API = 'http://192.168.8.107:9000'; // 袁琪
// BASE_API = 'http://192.168.8.177:9000'; // 旭强 // BASE_API = 'http://192.168.2.175:9000'; // 旭强 有线
BASE_API = 'http://192.168.8.177:9000'; // 旭强 无线
// BASE_API = 'http://192.168.2.183:9000'; // 张赛 // BASE_API = 'http://192.168.2.183:9000'; // 张赛
// BASE_API = 'http://192.168.8.140:9000'; // 杜康 // BASE_API = 'http://192.168.8.140:9000'; // 杜康
// BASE_API = 'http://b29z135112.zicp.vip'; // BASE_API = 'http://b29z135112.zicp.vip';

View File

@ -219,7 +219,7 @@ export default {
}); });
}, },
async start() { async start() {
const jumpFunc = ['jump', 'jump', 'enterIntegratedSimulation', 'jump', 'jumpScheduling', 'enterISCS', 'enterScreen']; const jumpFunc = ['jump', 'jump', 'enterIntegratedSimulation', 'jump', 'jumpScheduling', 'enterISCS', 'enterScreen', '', 'jump'];
this[jumpFunc[parseInt(this.courseModel.prdType) - 1]](); this[jumpFunc[parseInt(this.courseModel.prdType) - 1]]();
}, },
jumpSimulation() { jumpSimulation() {

View File

@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<div class="schema" :style="{top: offset+'px'}"> <div class="schema" :style="{top: offset+'px'}">
<select-station v-if="isLocalStation && !isScript" ref="selectStation" :style-css="'width: 100px;'" /> <select-station v-if="isShowSelectStation && !isScript" ref="selectStation" :style-css="'width: 100px;'" />
<el-select v-model="speed" style="width: 100px;" size="small" @change="speedChange"> <el-select v-model="speed" style="width: 100px;" size="small" @change="speedChange">
<el-option <el-option
v-for="item in speedList" v-for="item in speedList"
@ -110,6 +110,9 @@ export default {
isLocalStation() { isLocalStation() {
return this.$store.state.training.prdType === '01'; return this.$store.state.training.prdType === '01';
}, },
isShowSelectStation() {
return this.$store.state.training.prdType === '01' || this.$store.state.training.prdType === '09';
},
running() { running() {
return this.$store.state.training.started; return this.$store.state.training.started;
}, },

View File

@ -1,7 +1,12 @@
<template> <template>
<el-select v-model="oldShowMemberId" :style="styleCss" size="small" @change="switchStationMode"> <span>
<el-option v-for="item in stationListMode" :key="item.value" :label="item.name" :value="item.value" /> <el-select v-if="$store.state.training.prdType === '01'" v-model="oldShowMemberId" :style="styleCss" size="small" @change="switchStationMode">
</el-select> <el-option v-for="item in stationListMode" :key="item.value" :label="item.name" :value="item.value" />
</el-select>
<el-select v-else-if="$store.state.training.prdType === '09'" v-model="oldShowMemberId" :style="styleCss" size="small" @change="switchStationMode">
<el-option v-for="item in depotListMode" :key="item.value" :label="item.name" :value="item.value" />
</el-select>
</span>
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
@ -19,6 +24,7 @@ export default {
data() { data() {
return { return {
stationListMode: [], // stationListMode: [], //
depotListMode: [],
showMemberId: '', // memberId showMemberId: '', // memberId
oldShowMemberId: '', oldShowMemberId: '',
stationCentralizedMap: {}, stationCentralizedMap: {},
@ -57,12 +63,6 @@ export default {
this.showMemberId = val; this.showMemberId = val;
const member = this.$store.state.training.memberData[val]; const member = this.$store.state.training.memberData[val];
const station = this.$store.getters['map/getDeviceByCode'](member.deviceCode); const station = this.$store.getters['map/getDeviceByCode'](member.deviceCode);
// const lineCode = this.$store.getters['map/lineCode'];
// if ((lineCode === '02' || lineCode === '05') && station) {
// this.showStation = station.code;
// const showStationCode = this.stationCentralizedMap[station.code];
// this.setCenter(showStationCode);
// } else
if (station) { if (station) {
this.showStation = station.code; this.showStation = station.code;
const showStationCode = this.stationCentralizedMap[station.code]; const showStationCode = this.stationCentralizedMap[station.code];
@ -72,7 +72,7 @@ export default {
list.push(mapDevice[key]); list.push(mapDevice[key]);
} }
this.$store.dispatch('training/setRoleDeviceCode', station.code); this.$store.dispatch('training/setRoleDeviceCode', station.code);
this.$jlmap.updateShowStation(list, showStationCode); this.$jlmap.updateShowStation(list, showStationCode || station.code);
this.setCenter(showStationCode); this.setCenter(showStationCode);
} }
}).catch((err) => { }).catch((err) => {
@ -92,6 +92,11 @@ export default {
if (station) { if (station) {
this.stationListMode.push({value:item.id, name: station.name}); this.stationListMode.push({value:item.id, name: station.name});
} }
} else if (item.type === 'DEPOT_DISPATCHER') {
const station = this.$store.getters['map/getDeviceByCode'](item.deviceCode);
if (station) {
this.depotListMode.push({value:item.id, name: station.name});
}
} }
}); });
}, },
@ -100,6 +105,9 @@ export default {
if (item.type === 'STATION_SUPERVISOR' && item.userId == this.$store.state.user.id) { if (item.type === 'STATION_SUPERVISOR' && item.userId == this.$store.state.user.id) {
this.showMemberId = item.memberId; this.showMemberId = item.memberId;
this.oldShowMemberId = item.memberId; this.oldShowMemberId = item.memberId;
} else if (item.type === 'DEPOT_DISPATCHER' && item.userId == this.$store.state.user.id) {
this.showMemberId = item.memberId;
this.oldShowMemberId = item.memberId;
} }
}); });
this.stationList.forEach(item => { this.stationList.forEach(item => {

View File

@ -1,11 +1,47 @@
<template> <template>
<div v-loading="loading" class="view-control-content"> <div v-loading="loading" class="view-control-content">
<el-scrollbar wrap-class="scrollbar-wrapper"> <el-scrollbar wrap-class="scrollbar-wrapper">
<el-table :data="tableData" style="width: 80%; margin: 0 auto;">
<el-table-column label="车站">
<template slot-scope="scope">
<template v-for="stationCode in scope.row.stationCodeList">
<span :key="stationCode" style="margin-left: 10px">{{ getDeviceName(stationCode) }}</span>
</template>
</template>
</el-table-column>
<el-table-column label="操作" width="100px">
<template slot-scope="scope">
<el-button type="text" size="small" @click.native.prevent="editModel(tableData, scope.$index)">
编辑
</el-button>
<el-button type="text" size="small" @click.native.prevent="deleteModel(tableData, scope.$index)">
删除
</el-button>
</template>
</el-table-column>
</el-table>
<el-card class="box-card" shadow="never" style="width: 80%; margin: 0 auto 15px; border-top: none;"> <el-card class="box-card" shadow="never" style="width: 80%; margin: 0 auto 15px; border-top: none;">
<div slot="header"> <div slot="header" class="clearfix">
<span>请选择车辆段显示设备</span> <span style="font-size: 12px;">{{ cardTitle }}</span>
<el-button style="float: right; padding: 3px 3px" type="text" @click="clear">清空</el-button>
<el-button v-if="cardMode === 'generate'" style="float: right; padding: 3px 0" type="text" @click="generateOverlab">生成</el-button>
<el-button-group v-else-if=" cardMode === 'edit'" style="float: right;">
<el-button type="text" style="padding:3px 3px" @click="updateOverlab">修改</el-button>
<el-button type="text" style="padding:3px 0" @click="cancelOverlab">取消</el-button>
</el-button-group>
</div> </div>
<div style="padding: 10px;font-size: 14px;"> <div style="padding: 10px;font-size: 14px;">
<div>
<span>车站</span>
<el-select v-model="addModel.stationCodeList" size="mini" style="width: 300px;" multiple placeholder="请选择">
<el-option
v-for="item in stationList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</div>
<div class="content-box-list" style="margin-top: 10px;"> <div class="content-box-list" style="margin-top: 10px;">
<div class="title-box">设备列表</div> <div class="title-box">设备列表</div>
<div class="list-box" style="height:400px;overflow:auto"> <div class="list-box" style="height:400px;overflow:auto">
@ -17,10 +53,9 @@
</div> </div>
</div> </div>
</el-card> </el-card>
<div style="display: table; margin-left: 120px; margin-top: 12px; margin-bottom: 20px;"> <div style="display: table; margin-left: 150px; margin-top: 12px; margin-bottom: 20px;">
<el-button type="primary" size="small" :loading="dataLoading" @click="generateData">自动生成</el-button> <el-button type="primary" size="small" @click="generateData">生成</el-button>
<el-button type="primary" size="small" :loading="dataLoading" @click="save">保存</el-button> <el-button type="primary" size="small" :loading="dataLoading" @click="save">保存</el-button>
<el-button type="primary" size="small" :loading="dataLoading" @click="clear">清除</el-button>
<el-button type="primary" size="small" @click="back">返回</el-button> <el-button type="primary" size="small" @click="back">返回</el-button>
</div> </div>
</el-scrollbar> </el-scrollbar>
@ -44,13 +79,21 @@ export default {
}, },
data() { data() {
return { return {
tableData: [],
otherData: [], otherData: [],
addModel: { addModel: {
type: 'DEPOT_IL', type: 'LOCAL',
stationCodeList: [],
elementList: [] elementList: []
}, },
list: [],
field: '',
cardMode: 'generate',
index: '',
isPreview: true,
loading: false, loading: false,
dataLoading:false dataLoading:false,
depotStationList: []
}; };
}, },
computed: { computed: {
@ -74,7 +117,16 @@ export default {
'textList', 'textList',
'totalGuideLockButtonVOList', 'totalGuideLockButtonVOList',
'seclectDeviceList' 'seclectDeviceList'
]) ]),
cardTitle() {
if (this.cardMode === 'generate') {
return '生成数据';
} else if (this.cardMode === 'edit') {
return '编辑数据';
} else {
return '';
}
}
}, },
watch: { watch: {
selected: function (val, oldVal) { selected: function (val, oldVal) {
@ -86,9 +138,10 @@ export default {
}, },
methods: { methods: {
initData() { initData() {
this.$store.state.map.map.displayList.forEach(item => { this.depotStationList = this.stationList.filter(elem => elem.depot);
this.$store.state.map.map.displayList.forEach( item => {
if (item.type === 'DEPOT_IL') { if (item.type === 'DEPOT_IL') {
this.addModel = item; this.tableData.push(item);
} else { } else {
this.otherData.push(item); this.otherData.push(item);
} }
@ -111,6 +164,31 @@ export default {
const device = this.$store.getters['map/getDeviceByCode'](code); const device = this.$store.getters['map/getDeviceByCode'](code);
return device.name || device.code; return device.name || device.code;
}, },
deleteModel(list, index) {
list.splice(index, 1);
this.list.pop();
this.clearData();
this.cardMode = 'generate';
},
editModel(list, index) {
this.addModel = list[index];
this.index = index;
this.cardMode = 'edit';
},
cancelOverlab() {
this.cardMode = 'generate';
this.clear();
},
updateOverlab() {
if (this.index || this.index == 0) {
this.clearData();
if (!this.addModel.stationCodeList.length) {
this.$messageBox('请选择车站!');
return;
}
this.tableData.splice(this.index, 1, this.addModel);
}
},
// //
delList(model, list) { delList(model, list) {
list.forEach((nor, index) => { list.forEach((nor, index) => {
@ -124,32 +202,17 @@ export default {
} }
}); });
}, },
clear() {
this.addModel = { type: 'DEPOT_IL', elementList: [] };
const map = this.$store.state.map.map;
const param = {
displayList: [...this.otherData],
mapId: this.$route.params.mapId
};
this.dataLoading = true;
saveMap(Object.assign(map, param)).then(response => {
this.$message.success('保存车辆段配置成功');
this.dataLoading = false;
}).catch(() => {
this.dataLoading = false;
this.$messageBox('保存车辆段配置失败');
});
},
save() { save() {
const map = this.$store.state.map.map; const map = this.$store.state.map.map;
const param = { const param = {
displayList: [...this.otherData, this.addModel], displayList: [...this.tableData, ...this.otherData],
mapId: this.$route.params.mapId mapId: this.$route.params.mapId
}; };
this.dataLoading = true; this.dataLoading = true;
saveMap(Object.assign(map, param)).then(response => { saveMap(Object.assign(map, param)).then(response => {
this.$message.success('保存车辆段配置成功'); this.$message.success('保存车辆段配置成功');
this.dataLoading = false; this.dataLoading = false;
this.cancelOverlab();
}).catch(() => { }).catch(() => {
this.dataLoading = false; this.dataLoading = false;
this.$messageBox('保存车辆段配置失败'); this.$messageBox('保存车辆段配置失败');
@ -158,36 +221,55 @@ export default {
back() { back() {
this.$emit('goDraw'); this.$emit('goDraw');
}, },
generateOverlab() { //
if (!this.addModel.stationCodeList.length) {
this.$messageBox('请选择车站!');
return;
}
this.tableData.push(this.addModel);
this.clearData();
},
clear() {
this.addModel = { type: 'DEPOT_IL', stationCodeList: [], elementList: [] };
},
clearData() {
this.addModel = { type: 'DEPOT_IL', stationCodeList: [], elementList: [] };
this.index = '';
this.cardMode = 'generate';
},
generateData() { generateData() {
this.loading = true; this.loading = true;
this.addModel = { type: 'DEPOT_IL', elementList: [] }; this.tableData = [];
const station = this.stationList.find(item => item.depot); this.stationList.forEach(item => {
if (item.depot) {
this.tableData.push({type: 'DEPOT_IL', stationCodeList: [item.code], elementList: [item.code]});
}
});
[...this.sectionList, ...this.signalList, ...this.stationStandList, ...this.switchList, ...this.automaticRouteButtonList, [...this.sectionList, ...this.signalList, ...this.stationStandList, ...this.switchList, ...this.automaticRouteButtonList,
...this.axleCounterResetButtonList, ...this.cycleButtonList, ...this.indicatorLightList, ...this.lineList, ...this.outerFrameList, ...this.axleCounterResetButtonList, ...this.cycleButtonList, ...this.indicatorLightList, ...this.lineList, ...this.outerFrameList,
...this.responderList, ...this.tbStrategyList, ...this.tempSpeedLimitList, ...this.textList, ...this.totalGuideLockButtonVOList].forEach(item => { ...this.responderList, ...this.tbStrategyList, ...this.tempSpeedLimitList, ...this.textList, ...this.totalGuideLockButtonVOList].forEach(item => {
if (item.stationCode === station.code) { const target = this.tableData.find(elem => elem.stationCodeList.includes(item.stationCode));
this.addModel.elementList.push(item.code); target && target.elementList.push(item.code);
}
}); });
[...this.directionRodList].forEach(item => { [...this.directionRodList].forEach(item => {
if (item.deviceStationCode === station.code) { const target = this.tableData.find(elem => elem.stationCodeList.includes(item.deviceStationCode));
this.addModel.elementList.push(item.code); target && target.elementList.push(item.code);
}
}); });
this.psdList.forEach(item => { this.psdList.forEach(item => {
const stand = this.$store.getters['map/getDeviceByCode'](item.standCode); const stand = this.$store.getters['map/getDeviceByCode'](item.standCode);
if (stand.stationCode === station.code) { const target = this.tableData.find(elem => elem.stationCodeList.includes(stand.stationCode));
this.addModel.elementList.push(item.code); target && target.elementList.push(item.code);
}
}); });
const map = this.$store.state.map.map; const map = this.$store.state.map.map;
const param = { const param = {
displayList: [...this.otherData, this.addModel], displayList: [...this.tableData, ...this.otherData],
mapId: this.$route.params.mapId mapId: this.$route.params.mapId
}; };
saveMap(Object.assign(map, param)).then(response => { saveMap(Object.assign(map, param)).then(response => {
this.loading = false; this.loading = false;
this.$message.success('保存车辆段配置成功'); this.$message.success('保存车辆段配置成功');
this.cancelOverlab();
}).catch(() => { }).catch(() => {
this.loading = false; this.loading = false;
this.$messageBox('保存车辆段配置失败'); this.$messageBox('保存车辆段配置失败');

View File

@ -687,8 +687,6 @@ function timedCount() {
function callback(Response) { function callback(Response) {
data = JSON.parse(Response.body); data = JSON.parse(Response.body);
//
// console.log(data);
// console.log(data.type); // console.log(data.type);
if(data.type == "Train_Position"){ if(data.type == "Train_Position"){
postMessage(data); postMessage(data);
@ -716,7 +714,7 @@ function timedCount() {
return; return;
} }
if (data.body.type== "PSD") { if (data.body.deviceType== "PSD") {
postMessage(data); postMessage(data);
return; return;
} }