大铁CTC引导总锁

This commit is contained in:
fan 2023-02-09 09:28:32 +08:00
parent 0583f03479
commit 06214aa258
8 changed files with 109 additions and 68 deletions

View File

@ -254,7 +254,7 @@ class SkinCode extends defaultStyle {
/** 引导总锁 */ /** 引导总锁 */
this[deviceType.GuideLock] = { this[deviceType.GuideLock] = {
// 是否显示 // 是否显示s
text: { text: {
fontSize: 11, // 字体大小 fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细 fontWeight: 'normal', // 字体粗细
@ -265,7 +265,8 @@ class SkinCode extends defaultStyle {
radiusR: 6, // 控制灯大小 radiusR: 6, // 控制灯大小
controlColor: '#b5b3b3', // 控制灯颜色 (灰色) controlColor: '#b5b3b3', // 控制灯颜色 (灰色)
lightUpColor: '#FF0000' // 点亮灯颜色 lightUpColor: '#FF0000' // 点亮灯颜色
} },
mouseOverStyle: true
}; };
// 供电线路 // 供电线路

View File

@ -586,7 +586,8 @@ class SkinCode extends defaultStyle {
lamp: { lamp: {
radiusR: 6, // 控制灯大小 radiusR: 6, // 控制灯大小
controlColor: '#FFFF00' // 控制灯颜色 controlColor: '#FFFF00' // 控制灯颜色
} },
mouseOverStyle: {}
}; };
this[deviceType.PowerSupply] = { this[deviceType.PowerSupply] = {
text: { text: {
@ -808,14 +809,21 @@ class SkinCode extends defaultStyle {
text: { text: {
fontSize: 11, // 字体大小 fontSize: 11, // 字体大小
fontWeight: 'normal', // 字体粗细 fontWeight: 'normal', // 字体粗细
distance: 5 // 灯跟文字距离 distance: 5, // 灯跟文字距离
lightHighColor: '#0000FF', // 高亮颜色
flashColor: '#0000FF' // 闪烁颜色
}, },
lamp: { lamp: {
fill: 'rgba(0,0,0,0)', // 填充色 fill: 'rgba(0,0,0,0)', // 填充色
radiusR: 6, // 控制灯大小 radiusR: 6, // 控制灯大小
controlColor: '#b5b3b3', // 控制灯颜色 (灰色) controlColor: '#b5b3b3', // 控制灯颜色 (灰色)
lightUpColor: '#FF0000' // 点亮灯颜色 lightUpColor: '#FF0000', // 点亮灯颜色
} lightHighColor: '#00FFFF', // 高亮颜色
flashColor: '#0000FF' // 闪烁颜色
},
mouseOverStyle: true,
lightHigh: true, // 鼠标悬浮高亮
selectFlash: true // 选中闪烁
}; };
this[deviceType.TrainWindow] = { this[deviceType.TrainWindow] = {

View File

@ -124,7 +124,13 @@ export function parser(data, skinCode, showConfig) {
zrUtil.each(data.totalGuideLockButtonVOList || [], elem => { // 引导总锁列表 zrUtil.each(data.totalGuideLockButtonVOList || [], elem => { // 引导总锁列表
mapDevice[elem.code] = createDevice(deviceType.GuideLock, elem, propConvert, showConfig); mapDevice[elem.code] = createDevice(deviceType.GuideLock, elem, propConvert, showConfig);
if (!elem.direction) {
mapDevice[elem.stationCode].guideLockCode = elem.code; // 保证处理车站列表在处理引导总锁列表之前 mapDevice[elem.stationCode].guideLockCode = elem.code; // 保证处理车站列表在处理引导总锁列表之前
} else if (elem.direction === 'S') {
mapDevice[elem.stationCode].sGuideLockCode = elem.code;
} else if (elem.direction === 'X') {
mapDevice[elem.stationCode].xGuideLockCode = elem.code;
}
}, this); }, this);
zrUtil.each(data.automaticRouteButtonList || [], elem => { // 自动进路列表 zrUtil.each(data.automaticRouteButtonList || [], elem => { // 自动进路列表

View File

@ -28,26 +28,20 @@ export default class EMouse extends Group {
this.text.hide(); this.text.hide();
} }
mouseover(e) { mouseover(e) {
if (e && if (e && e.target && e.target._subType == 'Text') {
e.target &&
e.target._subType == 'Text') {
this.text.show(); this.text.show();
} else { } else if (this.device.style.GuideLock.lightHigh && !this.device.__down) {
// this.device.control.setControlColor(this.device.style.LcControl.mouseOverStyle.arcColor); this.device.control.setStyle({ fill: this.device.guideLock ? this.device.style.GuideLock.lamp.lightUpColor : this.device.style.GuideLock.lamp.lightHighColor });
// this.device.control.setTextColor(this.device.style.LcControl.mouseOverStyle.textColor); this.device.text.setStyle({ textFill: this.device.style.GuideLock.text.lightHighColor, textBackgroundColor: '#fff' });
} }
} }
mouseout(e) { mouseout(e) {
if (!this.device.__down) { if (e && e.target && e.target._subType == 'Text' && !this.device.__down) {
if (e &&
e.target &&
e.target._subType == 'Text') {
this.text.hide(); this.text.hide();
} else { } else if (this.device.style.GuideLock.lightHigh && !this.device.__down) {
// this.device.control.setControlColor(this.device.style.LcControl.lamp.controlColor); this.device.control.setStyle({ fill: this.device.style.GuideLock.lamp.controlColor });
// this.device.control.setTextColor('#FFFFFF'); this.device.text.setStyle({ textFill: '#FFFFFF', textBackgroundColor: '#000' });
}
} }
} }
} }

View File

@ -23,6 +23,7 @@ export default class GuideLock extends Group {
} }
this.model = model; this.model = model;
this.style = style; this.style = style;
this.guideLock = false;
this.create(); this.create();
this.createMouseEvent(); this.createMouseEvent();
this.setState(model); this.setState(model);
@ -34,6 +35,7 @@ export default class GuideLock extends Group {
_subType: 'Control', _subType: 'Control',
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z, z: this.z,
cursor: 'crosshair',
shape: { shape: {
cx: this.computedPosition.x, cx: this.computedPosition.x,
cy: this.computedPosition.y, cy: this.computedPosition.y,
@ -87,10 +89,14 @@ export default class GuideLock extends Group {
this.add(this.text); this.add(this.text);
} }
recover() { recover() {
this.control && this.control.stopAnimation(false);
this.text && this.text.stopAnimation(false);
this.control && this.control.show(); this.control && this.control.show();
this.text && this.text.show(); this.text && this.text.show();
this.subtitleText && this.subtitleText.show(); this.subtitleText && this.subtitleText.show();
this.control && this.control.setStyle({ fill: this.style.GuideLock.lamp.controlColor }); this.control && this.control.setStyle({ fill: this.style.GuideLock.lamp.controlColor });
this.text && this.text.setStyle({ textFill: '#fff', textBackgroundColor: '#000' });
this.__down = false;
} }
handleSignal() { handleSignal() {
this.control.setStyle({ fill: this.style.GuideLock.lamp.lightUpColor }); this.control.setStyle({ fill: this.style.GuideLock.lamp.lightUpColor });
@ -99,7 +105,24 @@ export default class GuideLock extends Group {
setAshShow() { setAshShow() {
this.control && this.control.setStyle({fill:'#FFF'}); this.control && this.control.setStyle({fill:'#FFF'});
} }
handleSelect() {
this.control && this.control.animateStyle(true)
.when(500, { fill: this.style.GuideLock.lamp.flashColor })
.when(1000, { fill: this.style.GuideLock.lamp.controlColor })
.start();
this.text && this.text.animateStyle(true)
.when(500, { textFill: this.style.GuideLock.text.flashColor })
.when(1000, { textFill: '#fff' })
.start();
this.__down = true;
setTimeout(() => {
this.control && this.control.stopAnimation(false);
this.text && this.text.stopAnimation(false);
this.control && this.control.setStyle({ fill: this.guideLock ? this.style.GuideLock.lamp.lightUpColor : this.style.GuideLock.lamp.controlColor });
this.text && this.text.setStyle({ textFill: '#fff', textBackgroundColor: '#000' });
this.__down = false;
}, 15000);
}
// 设置状态 // 设置状态
setState(model) { setState(model) {
// 只响应前端自定义类型的状态变化 // 只响应前端自定义类型的状态变化
@ -113,13 +136,17 @@ export default class GuideLock extends Group {
this.setAshShow(); this.setAshShow();
} else { } else {
model.totalGuideLock && this.handleSignal(); model.totalGuideLock && this.handleSignal();
model.hasSelected && this.handleSelect();
this.handleGuideLock(this.guideLock);
} }
} }
} }
handleGuideLock(flag) {
this.guideLock = flag;
this.control && this.control.setStyle({ fill: flag ? this.style.GuideLock.lamp.lightUpColor : this.style.GuideLock.lamp.controlColor });
}
createMouseEvent() { createMouseEvent() {
if (this.style.LcControl.mouseOverStyle) { if (this.style.GuideLock.mouseOverStyle) {
this.mouseEvent = new EMouse(this); this.mouseEvent = new EMouse(this);
this.add(this.mouseEvent); this.add(this.mouseEvent);
this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); }); this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); });

View File

@ -978,6 +978,7 @@ export default class Station extends Group {
model.emergencyController != undefined && this.handleEmergencyChange(model.emergencyController); model.emergencyController != undefined && this.handleEmergencyChange(model.emergencyController);
model.controlApplicant && this.handleControlApplicant(model); model.controlApplicant && this.handleControlApplicant(model);
model.allowAutonomy && this.handleAllowAutonomy(); model.allowAutonomy && this.handleAllowAutonomy();
this.handleGuideLock(model);
if (this.style.Station.syncCentralizeStation && (model.controlMode || model.controller || model.emergencyController != undefined) && model.centralized) { if (this.style.Station.syncCentralizeStation && (model.controlMode || model.controller || model.emergencyController != undefined) && model.centralized) {
model.chargeStationCodeList.forEach(item => { model.chargeStationCodeList.forEach(item => {
const device = store.getters['map/getDeviceByCode'](item); const device = store.getters['map/getDeviceByCode'](item);
@ -1018,6 +1019,13 @@ export default class Station extends Group {
} }
} }
handleGuideLock(model) {
const sGuideLock = store.getters['map/getDeviceByCode'](model.sGuideLockCode);
const xGuideLock = store.getters['map/getDeviceByCode'](model.xGuideLockCode);
console.log(model, model.sGuideMasterLock, model.xGuideMasterLock);
sGuideLock && sGuideLock.instance && sGuideLock.instance.handleGuideLock(model.sguideMasterLock);
xGuideLock && xGuideLock.instance && xGuideLock.instance.handleGuideLock(model.xguideMasterLock);
}
handlePreResetLamp() { handlePreResetLamp() {
this.controlPreReset && this.controlPreReset.setColor('#f00'); this.controlPreReset && this.controlPreReset.setColor('#f00');
} }

View File

@ -24,7 +24,7 @@
<center><b></b><b></b></center> <center><b></b><b></b></center>
</span> </span>
</button> </button>
<button :id="Station.guideLock.button.domId" :disabled="true" class="button_box" @click="buttonDown(Station.guideLock.button.operation, ['Button'])"> <button :id="Station.guideLock.button.domId" class="button_box" @click="buttonDown(Station.guideLock.button.operation, ['GuideLock'])">
<span :style="{color: operation === Station.guideLock.button.operation?'#ccc':'#800000'}"> <span :style="{color: operation === Station.guideLock.button.operation?'#ccc':'#800000'}">
<center><b></b><b></b></center> <center><b></b><b></b></center>
<center><b></b><b></b></center> <center><b></b><b></b></center>
@ -345,6 +345,9 @@ export default {
this.$store.dispatch('trainingNew/next', operate).then(({valid}) => { this.$store.dispatch('trainingNew/next', operate).then(({valid}) => {
if (valid) { if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true }); this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
if (operate.operationPre === this.Station.guideLock.button.operation) {
this.$refs.password.doShow({userOperationType: UserOperationType.LEFTCLICK, operation: operate.operation, operateNext: this.Command.close.password.operation });
}
} }
}).catch(e => { }).catch(e => {
console.error(e); console.error(e);
@ -371,38 +374,6 @@ export default {
} }
} }
}, },
// S
guideLockLeftButtonDown() {
const operate = {
userOperationType: UserOperationType.LEFTCLICK,
operation: this.Switch.guideLock.leftButton.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({valid}) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
operate.nextCmdType = CMD.Switch.CMD_SWITCH_MASTER_UNBLOCK;
operate.param = {right: false};
operate['operateNext'] = this.Command.close.password.operation;
this.$refs.password.doShow(operate);
}
});
},
// X
guideLockRightButtonDown() {
const operate = {
userOperationType: UserOperationType.LEFTCLICK,
operation: this.Switch.guideLock.rightButton.operation
};
this.$store.dispatch('trainingNew/next', operate).then(({valid}) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
operate.nextCmdType = CMD.Switch.CMD_SWITCH_MASTER_UNBLOCK;
operate.param = {right: true};
operate['operateNext'] = this.Command.close.password.operation;
this.$refs.password.doShow(operate);
}
});
},
buttonDown(operation, commandTypeList) { buttonDown(operation, commandTypeList) {
const station = this.$store.getters['map/getDeviceByCode'](this.$store.state.training.roleDeviceCode); const station = this.$store.getters['map/getDeviceByCode'](this.$store.state.training.roleDeviceCode);
if (!station || station.controlMode === 'Interlock') { return; } if (!station || station.controlMode === 'Interlock') { return; }
@ -420,7 +391,8 @@ export default {
const operationList = [ const operationList = [
this.Signal.humanTrainRoute.button.operation, this.Signal.humanTrainRoute.button.operation,
this.Section.fault.button.operation, this.Section.fault.button.operation,
this.Signal.guide.button.operation this.Signal.guide.button.operation,
this.Station.guideLock.button.operation
]; ];
if (operationList.includes(operation)) { if (operationList.includes(operation)) {
operate['operateNext'] = this.Command.close.password.operation; operate['operateNext'] = this.Command.close.password.operation;
@ -646,11 +618,19 @@ export default {
handleGuideLock(model) { handleGuideLock(model) {
const operate = { const operate = {
code: model.code, code: model.code,
operation: this.Signal.guide.button.operation, operation: this.Station.guideLock.button.operation,
userOperationType: UserOperationType.LEFTCLICK, userOperationType: UserOperationType.LEFTCLICK,
param: {signalCode: model.signalCode} param: {stationCode: model.stationCode, throat: model.direction}
}; };
this.$store.dispatch('trainingNew/next', operate); this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('training/updateMapState', [{code: model.code, _type: model._type, hasSelected: 1}]);
}
}).catch(e => {
console.error(e);
this.$refs.noticeInfo.doShow();
this.clearOperate();
});
}, },
handleFaultSection(model) { handleFaultSection(model) {
if (model._type === 'Section') { if (model._type === 'Section') {
@ -680,6 +660,7 @@ export default {
return; return;
} }
const buttonOperation = this.$store.state.menuOperation.buttonOperation; const buttonOperation = this.$store.state.menuOperation.buttonOperation;
console.log(model._type, buttonOperation, this.commandTypeList.includes(model._type), this.commandTypeList);
if (buttonOperation && this.commandTypeList.includes(model._type)) { if (buttonOperation && this.commandTypeList.includes(model._type)) {
if (buttonOperation === this.MixinCommand.totalCancel.button.operation) { if (buttonOperation === this.MixinCommand.totalCancel.button.operation) {
this.handleTotalCancel(model); this.handleTotalCancel(model);
@ -705,6 +686,8 @@ export default {
this.arrangementRouteOperation(model); this.arrangementRouteOperation(model);
} else if (buttonOperation === this.Signal.guide.button.operation ) { } else if (buttonOperation === this.Signal.guide.button.operation ) {
this.handleGuideSignal(model); this.handleGuideSignal(model);
} else if (buttonOperation === this.Station.guideLock.button.operation ) {
this.handleGuideLock(model);
} else if (buttonOperation === this.MixinCommand.functionButton.button.operation) { } else if (buttonOperation === this.MixinCommand.functionButton.button.operation) {
const signalButtonList = ['ASSIST', 'CHANGE_DIRECTION', 'PICK_ASSIST', 'DEPART_ASSIST', 'OCCLUSION', 'RECOVERY', 'ACCIDENT']; const signalButtonList = ['ASSIST', 'CHANGE_DIRECTION', 'PICK_ASSIST', 'DEPART_ASSIST', 'OCCLUSION', 'RECOVERY', 'ACCIDENT'];
if (model._type === 'SignalButton' && signalButtonList.includes(model.type)) { if (model._type === 'SignalButton' && signalButtonList.includes(model.type)) {
@ -789,14 +772,19 @@ export default {
operate.userOperationType = UserOperationType.LEFTCLICK; operate.userOperationType = UserOperationType.LEFTCLICK;
operate.over = true; operate.over = true;
operate.cmdType = CMD.Switch.CMD_SWITCH_BLOCK; operate.cmdType = CMD.Switch.CMD_SWITCH_BLOCK;
} else if (this.operation === OperationEvent.Station.guideLock.button.operation) {
operate.userOperationType = UserOperationType.LEFTCLICK;
operate.over = true;
operate.cmdType = CMD.Station.CMD_STATION_MASTER_LOCK;
} }
this.$store.dispatch('trainingNew/next', operate).then(({valid}) => { this.$store.dispatch('trainingNew/next', operate).then(({valid}) => {
if (valid) {
this.clearOperate();
}
}).catch(e => { }).catch(e => {
console.error(e); console.error(e);
this.$refs.noticeInfo.doShow(); this.$refs.noticeInfo.doShow();
}).finally(() => {
if (this.operation === OperationEvent.Station.guideLock.button.operation) {
this.$store.dispatch('training/updateMapState', [{code: this.selected.code, _type: this.selected._type, hasSelected: 0}]);
}
this.clearOperate(); this.clearOperate();
}); });
} }

View File

@ -114,6 +114,10 @@ export default {
{ name: '全线临时限速', value: 'LimitControl' }, { name: '全线临时限速', value: 'LimitControl' },
{ name: '站后折返', value: 'StationTurnBack' } { name: '站后折返', value: 'StationTurnBack' }
], ],
directionList: [
{ name: 'X方向', value: 'X' },
{ name: 'S方向', value: 'S' }
],
cardMode: 'generate', cardMode: 'generate',
addBackModel: { addBackModel: {
id: '', id: '',
@ -133,6 +137,7 @@ export default {
automaticRouteCode: '', // code automaticRouteCode: '', // code
cycleCode: '', // code cycleCode: '', // code
stationCode: '', // stationCode: '', //
direction: '',
position: { position: {
x: 0, x: 0,
y: 0 y: 0
@ -146,6 +151,7 @@ export default {
automaticRouteCode: '', // code automaticRouteCode: '', // code
cycleCode: '', // code cycleCode: '', // code
stationCode: '', // stationCode: '', //
direction: '',
position: { position: {
x: 0, x: 0,
y: 0 y: 0
@ -218,9 +224,10 @@ export default {
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px' }, { prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '20px' },
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px' } { prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px' }
] }, ] },
{ prop: 'direction', label: '方向:', type: 'select', optionLabel: 'name', optionValue: 'value', options: this.directionList },
{ prop:'automaticRouteCode', label: this.$t('map.automaticRouteCode'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.autoList, isHidden: !this.isHiddenAutomaticRoute, deviceChange: this.changeEditStation }, { prop:'automaticRouteCode', label: this.$t('map.automaticRouteCode'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.autoList, isHidden: !this.isHiddenAutomaticRoute, deviceChange: this.changeEditStation },
{ prop:'cycleCode', label: this.$t('map.cycleCode'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.autoList, isHidden: !this.isHiddenMapCycleButtonVO, deviceChange: this.changeEditStation }, { prop:'cycleCode', label: this.$t('map.cycleCode'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.autoList, isHidden: !this.isHiddenMapCycleButtonVO, deviceChange: this.changeEditStation },
{ prop:'stationCode', label: '所属车站', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.stationList, disabled: this.isDisabledStation, isHidden: !this.isHiddenStation } { prop:'stationCode', label: '所属车站:', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.stationList, disabled: this.isDisabledStation, isHidden: !this.isHiddenStation }
] ]
} }
} }
@ -324,6 +331,7 @@ export default {
automaticRouteCode: '', // code automaticRouteCode: '', // code
cycleCode: '', // code cycleCode: '', // code
stationCode: '', // stationCode: '', //
direction: '',
position: { position: {
x: 0, x: 0,
y: 0 y: 0
@ -450,6 +458,7 @@ export default {
y: this.addModel.position.y y: this.addModel.position.y
}, },
optionList: [], optionList: [],
direction: this.addModel.direction,
automaticRouteCode: this.addModel.automaticRouteCode, // code automaticRouteCode: this.addModel.automaticRouteCode, // code
cycleCode: this.addModel.cycleCode, // code cycleCode: this.addModel.cycleCode, // code
stationCode: this.addModel.stationCode // stationCode: this.addModel.stationCode //