jd1A调整,信号按钮调整

This commit is contained in:
Yuan 2022-08-02 18:12:03 +08:00
parent 838559280d
commit df174615ba
5 changed files with 837 additions and 697 deletions

View File

@ -259,7 +259,7 @@ class SkinCode extends defaultStyle {
this[deviceType.SignalButton] = {
shape: 'roundWithDock',
fillColor: '#808080',
showName: true
showName: true,
}
this[deviceType.SwitchFault] = {

View File

@ -37,6 +37,7 @@ export default class SignalButton extends Group {
this.z = 0
this.model = model
this.style = style
this.pressed = false
// Line
this.create()
this.setState(model)
@ -291,7 +292,6 @@ export default class SignalButton extends Group {
}
}
}
// let
// { value: 'PICK', label: '接车按钮' },
// { value: 'SHUNT_TERMINAL', label: '调车终端按钮' },
if (!store.getters['map/checkDeviceShow'](this._code)) {
@ -308,5 +308,26 @@ export default class SignalButton extends Group {
}
}
}
pressDown(flg, color) {
if (this.pressed === flg) return
if (this.arcShapeDock1) {
if (flg) {
this.arcShape.attr({ shape: { cy: this.arcShape.shape.cy + 2 }, z: this.z + 2, zlevel: this.zlevel })
if (color) {
this.arcShape
.animateStyle(true)
.when(0, { fill: '#69666E' })
.when(1000, { fill: color })
.when(2000, { fill: '#69666E' })
.start()
}
} else {
this.arcShape.attr({ shape: { cy: this.arcShape.shape.cy - 2 }, z: this.z + 2, zlevel: this.zlevel })
this.arcShape.stopAnimation(true)
this.recover()
}
this.pressed = flg
}
}
getAnchorPoint() {}
}

View File

@ -487,8 +487,6 @@ export default class Switch extends Group {
if (this.model.switchFaultCode) {
const switchFault = this.mapDevice[this.model.switchFaultCode];
if (this.style.SwitchFault.lamp.switchState) {
console.log(fault)
console.log(pos)
if (pos === 'N') switchFault.instance.setControlColor(this.style.SwitchFault.lamp.controlColor)
else if (pos === 'R') switchFault.instance.setControlColor(this.style.SwitchFault.lamp.reverseColor)
else if (pos === 'NO') switchFault.instance.setControlColor(this.style.SwitchFault.lamp.switchingColor)
@ -816,7 +814,6 @@ export default class Switch extends Group {
}
} else {
this.setSwitchFault(model);
console.log(model)
// model.pos == 'NO' || model.pos == 'EX';
// N-定位 R-反位 NO-无(失表) EX-挤叉

View File

@ -225,15 +225,15 @@ export default {
components: {
PasswordBox,
DefectiveShunting,
NoticeInfo
NoticeInfo,
},
props: {
selected: {
type: Object,
default: () => {
return null
}
}
},
},
},
data() {
return {
@ -264,8 +264,9 @@ export default {
buttonName: true,
signalName: true,
switchName: true,
sectionName: true
}
sectionName: true,
},
pressedSignalButton: null,
}
},
computed: {
@ -331,7 +332,7 @@ export default {
return CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE
}
return ''
}
},
},
watch: {
'$store.state.menuOperation.buttonOperation': function(val, old) {
@ -370,7 +371,7 @@ export default {
const station = this.$store.getters['map/getDeviceByCode'](val)
this.$store.getters['map/checkStationGuideMaster'](station.code, station.sGuideMasterLock, station.xGuideMasterLock)
}
}
},
},
beforeDestroy() {
this.routeDataMap = null
@ -385,12 +386,12 @@ export default {
over: true,
operation: data.operation,
cmdType: data.nextCmdType,
param: data.param
param: data.param,
}
} else {
operate = {
operationPre: data.operation,
operation: data.operateNext
operation: data.operateNext,
}
}
this.trainingOperation(operate)
@ -477,7 +478,7 @@ export default {
operation: this.Station.powerUnLock.button.operation,
cmdType: CMD.Station.CMD_STATION_POWER_ON_UNLOCK,
code: this.$store.state.map.showCentralizedStationCode,
param: { stationCode: this.$store.state.map.showCentralizedStationCode }
param: { stationCode: this.$store.state.map.showCentralizedStationCode },
}
this.$store
.dispatch('training/nextNew', operate)
@ -503,7 +504,7 @@ export default {
// S
guideLockLeftButtonDown() {
const operate = {
operation: this.Station.stationMasterLock.leftButton.operation
operation: this.Station.stationMasterLock.leftButton.operation,
}
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
@ -519,7 +520,7 @@ export default {
// X
guideLockRightButtonDown() {
const operate = {
operation: this.Station.stationMasterLock.rightButton.operation
operation: this.Station.stationMasterLock.rightButton.operation,
}
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
@ -532,17 +533,18 @@ export default {
}
})
},
buttonDown(operation, commandTypeList) {
buttonDown(operation, commandTypeList, color) {
this.clearOperate()
this.pressedSignalButton.instance.pressDown(true, color)
if (operation != this.Command.cancel.clearMbm.operation) {
const operate = {
operation: operation
operation: operation,
}
//
const operationList = [
this.Signal.humanTrainRoute.button.operation,
this.Section.fault.button.operation,
this.Section.defectiveShunting.button.operation
this.Section.defectiveShunting.button.operation,
]
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
@ -563,7 +565,7 @@ export default {
//
const operate = {
start: true,
operation: operation
operation: operation,
}
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
@ -595,7 +597,7 @@ export default {
// OR
arrangementRouteOperation(deviceList) {
const operate = {
operation: this.Signal.arrangementRoute.button.operation
operation: this.Signal.arrangementRoute.button.operation,
}
if (!this.routeDataMap) {
this.handleRouteDataMap()
@ -672,8 +674,8 @@ export default {
operation: this.$store.state.menuOperation.buttonOperation,
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_ROUTE,
param: {
signalCode: model._type === 'Signal' ? model.code : model.signalCode
}
signalCode: model._type === 'Signal' ? model.code : model.signalCode,
},
}
this.$store
.dispatch('training/nextNew', operate)
@ -693,7 +695,7 @@ export default {
code: model.code,
operation: this.Signal.guide.button.operation,
cmdType: CMD.Signal.CMD_SIGNAL_ROUTE_GUIDE,
param: { signalCode: model.signalCode }
param: { signalCode: model.signalCode },
}
const signal = this.$store.getters['map/getDeviceByCode'](model.signalCode)
// 15s
@ -711,7 +713,7 @@ export default {
code: model.code,
operation: this.$store.state.menuOperation.buttonOperation,
val: model.code,
cmdType: CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE
cmdType: CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE,
}
const signal = this.$store.getters['map/getDeviceByCode'](model.signalCode || model.code)
if (model._type === 'SignalButton' && model.type === 'PICK') {
@ -733,7 +735,7 @@ export default {
code: model.code,
operation: this.$store.state.menuOperation.buttonOperation,
cmdType: this.cmdType,
param: { switchCode: code }
param: { switchCode: code },
}
this.sendCommand(operate)
},
@ -770,7 +772,7 @@ export default {
code: model.code,
operation: buttonOperation,
cmdType: '',
param: {}
param: {},
}
if (model._type === 'Signal' && !this.checkHasTrainButton(model)) {
if (buttonOperation === this.Signal.lock.button.operation) {
@ -799,7 +801,7 @@ export default {
code: model.code,
operation: this.guideLockRightFlag ? this.Switch.guideLock.rightButton : this.Switch.guideLock.leftButton,
nextCmdType: CMD.Switch.CMD_SWITCH_MASTER_LOCK,
param: { signalCode: model.signalCode }
param: { signalCode: model.signalCode },
}
// 15s
if (signal.guideTime) {
@ -817,7 +819,7 @@ export default {
code: model.code,
operation: this.$store.state.menuOperation.buttonOperation,
cmdType: CMD.Section.CMD_SECTION_FAULT_UNLOCK,
param: { sectionCode: model.code }
param: { sectionCode: model.code },
}
this.sendCommand(operate)
}
@ -826,6 +828,10 @@ export default {
selectedChange() {
//
const model = this.selected //
if (this.pressedSignalButton /* && this.pressedSignalButton.code === model.code */) {
this.pressedSignalButton.instance.pressDown(false)
this.pressedSignalButton = null
}
if (
(this.$store.state.training.prdType != '01' && this.$store.state.training.prdType != '10') ||
this.selected._event !== MouseEvent.Left ||
@ -840,7 +846,7 @@ export default {
this.Switch.locate.button.operation,
this.Switch.reverse.button.operation,
this.Switch.block.button.operation,
this.Switch.unblock.button.operation
this.Switch.unblock.button.operation,
]
const signalButtonOperation = [
'LOCATE', //
@ -849,7 +855,9 @@ export default {
'UNLOCK', //
'BLOCK', //
'UNBLOCK', //,
'SECTION_FAULT_UNLOCK' //
'SECTION_FAULT_UNLOCK', //
'CANCEL', //
'HUMAN_RELEASE_ROUTE', //
]
if ((this.guideLockLeftFlag || this.guideLockRightFlag) && model._type === 'SignalButton' && model.type === 'GUIDE') {
this.handleGuideLock(model)
@ -884,21 +892,30 @@ export default {
this.guideLockRightButtonDown()
}
} else if (model._type === 'SignalButton' && signalButtonOperation.includes(model.type)) {
this.pressedSignalButton = model
const { lamp } = model.instance.style.SwitchFault
//
if (model.type === 'LOCATE') {
this.buttonDown(this.Switch.locate.button.operation, ['Switch', 'SwitchFault'])
this.buttonDown(this.Switch.locate.button.operation, ['Switch', 'SwitchFault'], lamp.controlColor)
} else if (model.type === 'REVERSE') {
this.buttonDown(this.Switch.reverse.button.operation, ['Switch', 'SwitchFault'])
this.buttonDown(this.Switch.reverse.button.operation, ['Switch', 'SwitchFault'], lamp.reverseColor)
} else if (model.type === 'MONOLOCK') {
this.buttonDown(this.Switch.lock.button.operation, ['Switch', 'SwitchFault'])
this.buttonDown(this.Switch.lock.button.operation, ['Switch', 'SwitchFault'], lamp.lockColor)
} else if (model.type === 'UNLOCK') {
this.buttonDown(this.Switch.unlock.button.operation, ['Switch', 'SwitchFault'])
this.buttonDown(this.Switch.unlock.button.operation, ['Switch', 'SwitchFault'], lamp.controlColor)
} else if (model.type === 'BLOCK') {
this.buttonDown(this.Switch.block.button.operation, ['Switch', 'SwitchFault'])
this.buttonDown(this.Switch.block.button.operation, ['Switch', 'SwitchFault'], lamp.blockColor)
} else if (model.type === 'UNBLOCK') {
this.buttonDown(this.Switch.unblock.button.operation, ['Switch', 'SwitchFault'])
this.buttonDown(this.Switch.unblock.button.operation, ['Switch', 'SwitchFault'], lamp.controlColor)
} else if (model.type === 'SECTION_FAULT_UNLOCK') {
this.buttonDown(this.Section.fault.button.operation, ['Section'])
//
this.buttonDown(this.Section.fault.button.operation, ['Section'], lamp.faultColor)
} else if (model.type === 'CANCEL') {
//
this.buttonDown(this.MixinCommand.totalCancel.button.operation, ['Signal', 'SignalButton'])
} else if (model.type === 'HUMAN_RELEASE_ROUTE') {
//
this.buttonDown(this.Signal.humanTrainRoute.button.operation, ['Signal', 'SignalButton'])
}
} else if (
(model._type === 'SignalButton' && !this.checkSignalBlock(model.signalCode)) ||
@ -930,11 +947,13 @@ export default {
this.deviceList &&
this.deviceList.length &&
this.$store.dispatch('training/updateMapState', [
{ code: this.deviceList[0].code, _type: this.deviceList[0]._type, hasSelected: 0 }
{ code: this.deviceList[0].code, _type: this.deviceList[0]._type, hasSelected: 0 },
])
this.deviceList = []
Handler.clear() //
this.$store.dispatch('menuOperation/setButtonOperation', null)
// this.pressedSignalButton && this.pressedSignalButton.instance.pressDown(false)
// this.pressedSignalButton = null
},
assistOperateOrChange(model) {
// mode.type==
@ -946,8 +965,8 @@ export default {
param: {
labelEnum: model.labelEnum,
stationCode: model.stationCode,
pressDown: model.pressDown ? 0 : 1 // 10
}
pressDown: model.pressDown ? 0 : 1, // 10
},
},
//
CHANGE_DIRECTION: {
@ -956,8 +975,8 @@ export default {
param: {
labelEnum: model.labelEnum,
stationCode: model.stationCode,
pressDown: model.pressDown ? 0 : 1 // 10
}
pressDown: model.pressDown ? 0 : 1, // 10
},
},
//
PICK_ASSIST: {
@ -966,8 +985,8 @@ export default {
nextCmdType: CMD.CTC.CTC_ASSIST_PRESS_RECEIVE_ASSIST,
param: {
labelEnum: model.labelEnum,
stationCode: model.stationCode
}
stationCode: model.stationCode,
},
},
//
DEPART_ASSIST: {
@ -975,8 +994,8 @@ export default {
nextCmdType: CMD.CTC.CTC_ASSIST_PRESS_DELIVER_ASSIST,
param: {
labelEnum: model.labelEnum,
stationCode: model.stationCode
}
stationCode: model.stationCode,
},
},
//
ACCIDENT: {
@ -984,9 +1003,9 @@ export default {
nextCmdType: CMD.CTC.CTC_ASSIST_PRESS_ACCIDENT,
param: {
labelEnum: model.labelEnum,
stationCode: model.stationCode
}
}
stationCode: model.stationCode,
},
},
}
const noPasswordModelTypeMap = {
//
@ -995,8 +1014,8 @@ export default {
nextCmdType: CMD.CTC.CTC_ASSIST_PRESS_BLOCK,
param: {
labelEnum: model.labelEnum,
stationCode: model.stationCode
}
stationCode: model.stationCode,
},
},
//
RECOVERY: {
@ -1004,9 +1023,9 @@ export default {
nextCmdType: CMD.CTC.CTC_ASSIST_PRESS_RESTORE,
param: {
labelEnum: model.labelEnum,
stationCode: model.stationCode
}
}
stationCode: model.stationCode,
},
},
}
if (noPasswordModelTypeMap[model.type]) {
const operate = {
@ -1014,7 +1033,7 @@ export default {
operation: noPasswordModelTypeMap[model.type].operation,
code: model.code,
param: noPasswordModelTypeMap[model.type].param,
cmdType: noPasswordModelTypeMap[model.type].nextCmdType
cmdType: noPasswordModelTypeMap[model.type].nextCmdType,
}
this.$store
.dispatch('training/nextNew', operate)
@ -1033,7 +1052,7 @@ export default {
const operate = {
operation: modelTypeMap[model.type].operation,
code: model.code,
param: modelTypeMap[model.type].param
param: modelTypeMap[model.type].param,
}
this.$store
.dispatch('training/nextNew', operate)
@ -1066,8 +1085,8 @@ export default {
// console.error(error);
// this.$refs.noticeInfo.doShow();
// });
}
}
},
},
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>

File diff suppressed because it is too large Load Diff