This commit is contained in:
fan 2022-04-29 16:32:40 +08:00
commit b164e99a77
7 changed files with 207 additions and 98 deletions

View File

@ -956,7 +956,9 @@ class SkinCode extends defaultStyle {
stroke: '#fff',
fontSize: 11,
defaultText: '发车',
defaultColor: '#ccc'
defaultColor: '#ccc',
occupiedColor:'#f00',
noOccupiedColor:'#00ff00',
};
this[deviceType.PickArrow] = {
triangleLength: 15,
@ -967,7 +969,9 @@ class SkinCode extends defaultStyle {
stroke: '#fff',
fontSize: 11,
defaultText: '接车',
defaultColor: '#ccc'
defaultColor: '#ccc',
occupiedColor:'#f00',
noOccupiedColor:'#ffff00',
};
this[deviceType.Occlusion] = {
text: {
@ -1043,7 +1047,8 @@ class SkinCode extends defaultStyle {
},
lamp: {
radiusR: 6,
controlColor: '#ccc'
controlColor: '#ccc',
occupiedColor:'#ffffff',
}
};
this[deviceType.SectionOccupied] = {
@ -1054,7 +1059,8 @@ class SkinCode extends defaultStyle {
},
lamp: {
radiusR: 6,
controlColor: '#ccc'
controlColor: '#ccc',
occupiedColor:'#ff0000',
}
};
}

View File

@ -478,14 +478,21 @@ class Jlmap {
// store.state.map.map.indicatorLightList;
// 改方按钮状态
const signalButtonList = store.state.map.map.signalButtonList;
const signalButton = signalButtonList.find(elem=>{
const selectButtonList = signalButtonList.filter(elem=>{
return elem.labelEnum === directionData.labelEnum && elem.stationCode == directionData.stationCode;
});
if (signalButton && elem.changeDirectionStatus != undefined) {
const buttonModel = this.mapDevice[signalButton.code];
buttonModel.pressDown = elem.changeDirectionStatus;
this.$painter.update(buttonModel);
}
const selectMap = {'ASSIST':'mainAssistStatus', 'PICK_ASSIST':'receiveAssistStatus', 'DEPART_ASSIST':'deliverAssistStatus', 'CHANGE_DIRECTION':'changeDirectionStatus'};
// { value: 'ASSIST', label: '总辅助按钮' },
// { value: 'PICK_ASSIST', label: '接辅助按钮' },
// { value: 'DEPART_ASSIST', label: '发辅助按钮' },
selectButtonList.forEach(each=>{
const buttonModel = this.mapDevice[each.code];
const selectedStatus = selectMap[buttonModel.type];
if (selectedStatus != undefined && elem[selectedStatus] != undefined) {
buttonModel.pressDown = elem[selectedStatus];
this.$painter.update(buttonModel);
}
});
// 接车 发车 区间占用 辅助状态
const indicatorLightList = store.state.map.map.indicatorLightList;
@ -497,16 +504,22 @@ class Jlmap {
switch (each._type) {
case 'PickArrow': {
// 接车灯状态
if (elem.receiveAspect != undefined) {
model.aspect = elem.receiveAspect;
if (elem.runStatus != undefined) {
model.runStatus = elem.runStatus;
if (elem.receiveAspect != undefined) {
model.aspect = elem.receiveAspect;
}
this.$painter.update(model);
}
break;
}
case 'DepartArrow': {
// 发车灯状态
if (elem.deliverAspect != undefined) {
model.aspect = elem.deliverAspect;
if (elem.runStatus != undefined) {
model.runStatus = elem.runStatus;
if (elem.deliverAspect != undefined) {
model.aspect = elem.deliverAspect;
}
this.$painter.update(model);
}
break;

View File

@ -33,8 +33,8 @@ export default class SaidLamp extends Group {
create() {
const model = this.model;
const lampDevice = ['LeuControl', 'IntersiteControl', 'CenterCommunication', 'AtsControl', 'LocalControl', 'ChainControl', 'Maintain',
'PowerSupply', 'MaintenanceLamps', 'ZcCommunication', 'SwitchFault', 'SectionOccupied', 'AssistStatus', 'TotalAssist', 'DepartAssist',
'PickAssist', 'Recovery', 'Accident', 'Occlusion'];
'PowerSupply', 'MaintenanceLamps', 'ZcCommunication', 'SwitchFault', 'SectionOccupied', 'AssistStatus', 'TotalAssist', 'TotalAssist', 'PickAssist', 'Recovery', 'Accident', 'Occlusion'];
if (lampDevice.includes(this._type)) {
this.control = new EControl({
zlevel: this.zlevel,
@ -179,7 +179,7 @@ export default class SaidLamp extends Group {
_subType: 'IndicatorLight'
});
this.add(this.control);
} else if (this._type === 'PickArrow'|| this._type === 'DepartArrow') {
} else if (this._type === 'PickArrow' || this._type === 'DepartArrow') {
this.control = new EPickOrDepartArrow({
zlevel: this.zlevel,
z: this.z,
@ -201,7 +201,7 @@ export default class SaidLamp extends Group {
this.control && this.control.hide();
} else {
// 区段占用,辅助状态,接发车箭头
const datieType = [deviceType.SectionOccupied, deviceType.AssistStatus, deviceType.PickArrow ,deviceType.DepartArrow];
const datieType = [deviceType.SectionOccupied, deviceType.AssistStatus, deviceType.PickArrow, deviceType.DepartArrow];
if (model._type === deviceType.PowerSupply && model.name.includes('2')) {
this.control && this.control.setControlColor(this.deviceStyle.lamp.offColor);
this.control && this.control.setControlStroke(this.deviceStyle.lamp.strokeColor, 1);
@ -209,17 +209,40 @@ export default class SaidLamp extends Group {
this.control && this.control.setControlColor(this.deviceStyle.lamp.offColor);
} else if (datieType.includes(model._type)) {
if (model.aspect) {
if (model.aspect == 'WF') {
this.control && this.control.setControlFlashing('#FFFFFF');
} else {
let defalutColor;
if (model._type == deviceType.PickArrow || model._type == deviceType.DepartArrow) {
defalutColor = this.deviceStyle.fill;
} else {
defalutColor = this.deviceStyle.lamp.controlColor;
// 接车
if (model._type == deviceType.PickArrow) { // 接车灯
if (model.runStatus == 'R') { // 接车
// 接车状态:发车灯灭,接车灯默认是黄色,占用时红色
if (model.aspect == 'O') {
this.control && this.control.setControlColor(this.deviceStyle.occupiedColor);
} else if (model.aspect == 'F') {
this.control && this.control.setControlColor(this.deviceStyle.noOccupiedColor);
}
} else if (model.runStatus == 'D') { // 发车
this.control && this.control.setControlColor(this.deviceStyle.fill);
}
} else if (model._type == deviceType.DepartArrow) { // 发车灯
if (model.runStatus == 'D') { // 发车
// 发车状态:接车灯灭,发车灯默认是绿色,占用时红色
if (model.aspect == 'O') {
this.control && this.control.setControlColor(this.deviceStyle.occupiedColor);
} else if (model.aspect == 'F') {
this.control && this.control.setControlColor(this.deviceStyle.noOccupiedColor);
}
} else if (model.runStatus == 'R') { // 接车
this.control && this.control.setControlColor(this.deviceStyle.fill);
}
} else {
switch (model.aspect) {
case 'O':
this.control && this.control.setControlColor(this.deviceStyle.lamp.occupiedColor);
break;
case 'F':
this.control && this.control.setControlColor(this.deviceStyle.lamp.controlColor);
break;
default:
break;
}
const colorMap = {'No':defalutColor, 'R':'#FF0000', 'G':'#00FF00', 'Y':'#FFFF00', 'W':'#FFFFFF'};
this.control && this.control.setControlColor(colorMap[model.aspect]);
}
}

View File

@ -72,70 +72,70 @@ export default class SignalButton extends Group {
this.add(this.rightLine);
this.rightLine.hide();
this.leftBoard = new Line({
zlevel: this.zlevel,
z: this.z + 1,
shape: {
x1: model.position.x - 1,
y1: model.position.y - 1,
x2: model.position.x - 1,
y2: model.position.y + 15
},
style: {
lineWidth: 2,
stroke: '#FFFFFF'
}
});
zlevel: this.zlevel,
z: this.z + 1,
shape: {
x1: model.position.x - 1,
y1: model.position.y - 1,
x2: model.position.x - 1,
y2: model.position.y + 15
},
style: {
lineWidth: 2,
stroke: '#FFFFFF'
}
});
this.add(this.leftBoard);
this.leftBoard.hide();
this.topBoard = new Line({
zlevel: this.zlevel,
z: this.z + 1,
shape: {
x1: model.position.x - 1,
y1: model.position.y - 1,
x2: model.position.x + 15,
y2: model.position.y - 1
},
style: {
lineWidth: 2,
stroke: '#FFFFFF'
}
});
zlevel: this.zlevel,
z: this.z + 1,
shape: {
x1: model.position.x - 1,
y1: model.position.y - 1,
x2: model.position.x + 15,
y2: model.position.y - 1
},
style: {
lineWidth: 2,
stroke: '#FFFFFF'
}
});
this.add(this.topBoard);
this.topBoard.hide();
this.rightBoard = new Line({
zlevel: this.zlevel,
z: this.z + 1,
shape: {
x1: model.position.x + 15,
y1: model.position.y - 1,
x2: model.position.x + 15,
y2: model.position.y + 15
},
style: {
lineWidth: 2,
stroke: '#A0A0A0'
}
});
zlevel: this.zlevel,
z: this.z + 1,
shape: {
x1: model.position.x + 15,
y1: model.position.y - 1,
x2: model.position.x + 15,
y2: model.position.y + 15
},
style: {
lineWidth: 2,
stroke: '#A0A0A0'
}
});
this.add(this.rightBoard);
this.rightBoard.hide();
this.bottomBoard = new Line({
zlevel: this.zlevel,
z: this.z + 1,
shape: {
x1: model.position.x - 1,
y1: model.position.y + 15,
x2: model.position.x + 15,
y2: model.position.y + 15,
},
style: {
lineWidth: 2,
stroke: '#A0A0A0'
}
});
zlevel: this.zlevel,
z: this.z + 1,
shape: {
x1: model.position.x - 1,
y1: model.position.y + 15,
x2: model.position.x + 15,
y2: model.position.y + 15
},
style: {
lineWidth: 2,
stroke: '#A0A0A0'
}
});
this.add(this.bottomBoard);
this.bottomBoard.hide();
const hasTextList = ['PASS', 'ASSIST', 'PICK_ASSIST', 'DEPART_ASSIST', 'ACCIDENT', 'CHANGE_DIRECTION'];
const hasTextList = ['PASS', 'ASSIST', 'PICK_ASSIST', 'DEPART_ASSIST', 'ACCIDENT', 'CHANGE_DIRECTION', ''];
if (hasTextList.includes(model.type)) {
this.buttonText = new Text({
zlevel: this.zlevel,
@ -215,7 +215,11 @@ export default class SignalButton extends Group {
}
setState(model) {
this.recover();
if (model.type == 'CHANGE_DIRECTION') {
// { value: 'ASSIST', label: '总辅助按钮' },
// { value: 'PICK_ASSIST', label: '接辅助按钮' },
// { value: 'DEPART_ASSIST', label: '发辅助按钮' },
const list = ['ASSIST', 'PICK_ASSIST', 'DEPART_ASSIST', 'CHANGE_DIRECTION'];
if (list.includes(model.type)) {
if (this.rectButton) {
if (model.pressDown) {
this.rectButton.setStyle({ fill:'#FFFF00' });

View File

@ -644,11 +644,12 @@ export default {
this.clearOperate();
}
} else if (!buttonOperation) {
const signalButtonList = ['ASSIST', 'CHANGE_DIRECTION', 'PICK_ASSIST', 'DEPART_ASSIST'];
if (model._type === 'SignalButton' && !this.checkSignalBlock(model.signalCode) && model.type === 'GUIDE' ) {
this.handleGuideSignal(model);
} else if (model._type === 'SignalButton' && model.type === 'CHANGE_DIRECTION') {
//
this.changeDirection(model);
} else if (model._type === 'SignalButton' && signalButtonList.includes(model.type)) {
//
this.assistOperateOrChange(model);
} else if (model._type === 'SignalButton' && !this.checkSignalBlock(model.signalCode) || (model._type === 'Signal' && !model.blockade)) {
this.deviceList.push(model);
this.arrangementRouteOperation(this.deviceList);
@ -670,18 +671,57 @@ export default {
Handler.clear(); //
this.$store.dispatch('menuOperation/setButtonOperation', null);
},
changeDirection(model) {
const operate = {
operation: this.CTCCommand.assistPressDownTurnDirection.menu.operation,
code: model.code,
param: {
labelEnum:model.labelEnum,
stationCode:model.stationCode
assistOperateOrChange(model) {
// mode.type==
const modelTypeMap = {
//
'ASSIST':{
operation:this.CTCCommand.assistPressMainAssist.menu.operation,
nextCmdType:CMD.CTC.CTC_ASSIST_PRESS_MAIN_ASSIST,
param:{
labelEnum:model.labelEnum,
stationCode:model.stationCode,
pressDown:model.pressDown ? 0 : 1 // 10
}
},
//
'CHANGE_DIRECTION':{
operation:this.CTCCommand.assistPressDownTurnDirection.menu.operation,
nextCmdType:CMD.CTC.CTC_ASSIST_PRESS_DOWN_TURN_DIRECTION,
param:{
labelEnum:model.labelEnum,
stationCode:model.stationCode,
pressDown:model.pressDown ? 0 : 1 // 10
}
},
//
'PICK_ASSIST':{
// this.CTCCommand.assistPressDownTurnDirection.menu.operation
operation:this.CTCCommand.assistPressReceiveAssist.menu.operation,
nextCmdType:CMD.CTC.CTC_ASSIST_PRESS_RECEIVE_ASSIST,
param:{
labelEnum:model.labelEnum,
stationCode:model.stationCode
}
},
//
'DEPART_ASSIST':{
operation:this.CTCCommand.assistPressDeliverAssist.menu.operation,
nextCmdType:CMD.CTC.CTC_ASSIST_PRESS_DELIVER_ASSIST,
param:{
labelEnum:model.labelEnum,
stationCode:model.stationCode
}
}
};
const operate = {
operation: modelTypeMap[model.type].operation,
code: model.code,
param: modelTypeMap[model.type].param
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
operate.nextCmdType = CMD.CTC.CTC_ASSIST_PRESS_DOWN_TURN_DIRECTION;
operate.nextCmdType = modelTypeMap[model.type].nextCmdType;
operate['operateNext'] = this.Command.close.password.operation;
this.$refs.password.doShow(operate);
}

View File

@ -371,6 +371,10 @@ export default {
CTC_RECEIVING_NOTICE: {value: 'CTC_RECEIVING_NOTICE', label: '接预'},
CTC_DEPARTURE_NOTICE: {value: 'CTC_DEPARTURE_NOTICE', label: '发预'},
CTC_ASSIST_PRESS_DOWN_TURN_DIRECTION:{value:'ASSIST_PRESS_DOWN_TURN_DIRECTION', label:'改方'},
CTC_AUTO_TRIGGER: {value: 'CTC_AUTO_TRIGGER', label: '自动触发'}
CTC_AUTO_TRIGGER: {value: 'CTC_AUTO_TRIGGER', label: '自动触发'},
CTC_ASSIST_PRESS_MAIN_ASSIST:{value: 'ASSIST_PRESS_MAIN_ASSIST', label: '总辅助'},
CTC_ASSIST_PRESS_RECEIVE_ASSIST:{value: 'ASSIST_PRESS_RECEIVE_ASSIST', label: '接辅助'},
CTC_ASSIST_PRESS_DELIVER_ASSIST:{value: 'ASSIST_PRESS_DELIVER_ASSIST', label: '发辅助'}
}
};

View File

@ -3556,12 +3556,31 @@ export const OperationEvent = {
domId: '_Tips-CTC-AssistPressDownTurnDirection-Menu{TOP}'
}
},
autoTrigger: {
autoTrigger: {
menu: {
operation: '1103',
domId: '_Tips-CTC-AutoTrigger-Menu{TOP}'
}
}
domId: '_Tips-CTC-AutoTrigger-Menu{TOP}'
}
},
assistPressMainAssist:{
menu: {
operation: '1104',
domId: '_Tips-CTC-AssistPressMainAssist-Menu{TOP}'
}
},
assistPressReceiveAssist:{
menu: {
operation: '1105',
domId: '_Tips-CTC-AssistPressReceiveAssist-Menu{TOP}'
}
},
assistPressDeliverAssist:{
menu: {
operation: '1106',
domId: '_Tips-CTC-AssistPressDeliverAssist-Menu{TOP}'
}
}
}
};