修改 道岔位置定位、反位 为pos字段

This commit is contained in:
joylink_cuiweidong 2021-09-09 14:15:23 +08:00
parent 7d21d75ad0
commit d541259695
15 changed files with 136 additions and 121 deletions

View File

@ -33,7 +33,6 @@ deviceState[deviceType.Switch] = {
routeLock: 0, // 是否进路锁闭
overlapLock: 0, // 是否进路延续保护锁闭
pos:'N', // // 道岔位置定位、反位 N-定位 R-反位 NO-无(失表) EX-挤叉
// reversePosition: 0, // 是否反位
isCiConfirm: 0, // 是否进行联锁确认
/** 定位状态*/
// locateType: {

View File

@ -46,7 +46,6 @@ class Status {
routeLock: device.routeLock, // 是否进路锁闭
overlapLock: device.overlapLock, // 是否进路延续保护锁闭
pos:device.pos, // 道岔位置定位、反位 N-定位 R-反位 NO-无(失表) EX-挤叉
// reversePosition: device.pos == 'R', // 是否反位
fault: device.fault /** 非故障*/
};
}

View File

@ -93,12 +93,12 @@ export default class EBadShunt extends Group {
if (swch && swch.instance) {
const traingle = new JTriangle(swch.intersection, swch.skew);
if ((swch.intersection.x === beg.x) && (swch.intersection.y === beg.y) && !swch.normalPosition && swch.sectionCCode == model.code) {
if ((swch.intersection.x === beg.x) && (swch.intersection.y === beg.y) && swch.pos != 'N' && swch.sectionCCode == model.code) {
beg.x = beg.x + traingle.drictx * (swPadding + switchWidth) * traingle.getCotRate();
beg.y = beg.y + traingle.dricty * (swPadding + switchWidth);
}
if ((swch.intersection.x === end.x) && (swch.intersection.y === end.y) && swch.normalPosition && swch.sectionCCode == model.code) {
if ((swch.intersection.x === end.x) && (swch.intersection.y === end.y) && swch.pos == 'N' && swch.sectionCCode == model.code) {
end.x = end.x + traingle.drictx * (swPadding + switchWidth) * traingle.getCotRate();
end.y = end.y + traingle.dricty * (swPadding + switchWidth);
}

View File

@ -93,12 +93,12 @@ export default class ELimitLines extends Group {
if (swch && swch.instance) {
const traingle = new JTriangle(swch.intersection, swch.skew);
if ((swch.intersection.x === beg.x) && (swch.intersection.y === beg.y) && !swch.normalPosition && swch.sectionCCode == model.code) {
if ((swch.intersection.x === beg.x) && (swch.intersection.y === beg.y) && swch.pos != 'N' && swch.sectionCCode == model.code) {
beg.x = beg.x + traingle.drictx * (swPadding + switchWidth) * traingle.getCotRate();
beg.y = beg.y + traingle.dricty * (swPadding + switchWidth);
}
if ((swch.intersection.x === end.x) && (swch.intersection.y === end.y) && swch.normalPosition && swch.sectionCCode == model.code) {
if ((swch.intersection.x === end.x) && (swch.intersection.y === end.y) && swch.pos == 'N' && swch.sectionCCode == model.code) {
end.x = end.x + traingle.drictx * (swPadding + switchWidth) * traingle.getCotRate();
end.y = end.y + traingle.dricty * (swPadding + switchWidth);
}

View File

@ -388,17 +388,18 @@ export default class Section extends Group {
const sectionB = this.mapDevice[switchModel.sectionBCode];
const sectionC = this.mapDevice[switchModel.sectionCCode];
const sectionA = this.mapDevice[switchModel.sectionACode];
if (switchModel && switchModel.normalPosition === 1) {
// N-定位 R-反位 NO-无(失表) EX-挤叉
if (switchModel && switchModel.pos === 'N') {
this.setSwitchSectionColor(sectionC, sectionB);// 定位
} else if (switchModel && switchModel.normalPosition === 0 && switchModel.reversePosition === 0 && switchModel.instance && switchModel.instance.switchPosition === 'reverse' && switchModel.fault !== 'SPLIT') {
} else if (switchModel && switchModel.pos == 'NO' && switchModel.instance && switchModel.instance.switchPosition === 'reverse' && switchModel.fault !== 'SPLIT') {
this.setSwitchSectionColor(sectionC, sectionB);// 反位转定位前
} else if (switchModel && switchModel.normalPosition === 0 && switchModel.reversePosition === 0 && switchModel.instance && switchModel.instance.switchPosition === 'normal' && (switchModel.fault === 'SPLIT' || switchModel.fault === 'NORMAL_SPLIT')) {
} else if (switchModel && switchModel.pos == 'NO' && switchModel.instance && switchModel.instance.switchPosition === 'normal' && (switchModel.fault === 'SPLIT' || switchModel.fault === 'NORMAL_SPLIT')) {
this.setSwitchSectionColor(sectionC, sectionB);// 定位变失表或定位失表
} else if (switchModel && switchModel.reversePosition === 1) {
} else if (switchModel && switchModel.pos === 'R') {
this.setSwitchSectionColor(sectionB, sectionC); // 反位
} else if (switchModel && switchModel.normalPosition === 0 && switchModel.reversePosition === 0 && switchModel.instance && switchModel.instance.switchPosition === 'normal' && switchModel.fault !== 'SPLIT') {
} else if (switchModel && switchModel.pos == 'NO' && switchModel.instance && switchModel.instance.switchPosition === 'normal' && switchModel.fault !== 'SPLIT') {
this.setSwitchSectionColor(sectionB, sectionC); // 定位转反位前
} else if (switchModel && switchModel.normalPosition === 0 && switchModel.reversePosition === 0 && switchModel.instance && switchModel.instance.switchPosition === 'reverse' && (switchModel.fault === 'SPLIT' || switchModel.fault === 'REVERSE_SPLIT')) {
} else if (switchModel && switchModel.pos == 'NO' && switchModel.instance && switchModel.instance.switchPosition === 'reverse' && (switchModel.fault === 'SPLIT' || switchModel.fault === 'REVERSE_SPLIT')) {
this.setSwitchSectionColor(sectionB, sectionC);// 反位变失表后反位失表
}
if (this.style.Section.switchFault && switchModel.fault === 'SQUEEZE') {

View File

@ -86,12 +86,12 @@ class EMouse extends Group {
stroke: this.device.__over
? this.device.style.Switch.mouseOverStyle.coreBackgroundColorOver
: this.device.style.Switch.mouseOverStyle.coreBackgroundColor
})
});
this.device.shapeModelB.addHover({
stroke: this.device.__over
? this.device.style.Switch.mouseOverStyle.coreBackgroundColorOver
: this.device.style.Switch.mouseOverStyle.coreBackgroundColor
})
});
}
const section = store.getters['map/getDeviceByCode'](this.device.model.sectionACode) || {};
@ -114,7 +114,8 @@ class EMouse extends Group {
if (this.device.style.Switch.mouseOverStyle.coreBackgroundColor) {
this.device.shapeModelA.removeHover();
this.device.shapeModelB.removeHover();
if (this.device.model.normalPosition) {
// if (this.device.model.normalPosition) {
if (this.device.model.pos == 'N') {
this.device.shapeModelA.hide();
this.device.shapeModelB.show();
} else {

View File

@ -433,15 +433,17 @@ export default class Switch extends Group {
.when(1000, { stroke: this.style.backgroundColor })
.start();
}
setSwitchFault(fault, normalPosition, reversePosition) {
if (this.style.Switch.jointImg.faultStatus && fault && !reversePosition && !normalPosition ) { // 宁波线失表状态
// N-定位 R-反位 NO-无(失表) EX-挤叉
setSwitchFault(fault, pos) {
if (this.style.Switch.jointImg.faultStatus && fault && (pos == 'NO' || pos == 'EX') ) { // 宁波线失表状态
this.setForkAction(); // 道岔挤岔
} else if (this.style.Switch.faultNoHandle ) {
this.shapeModelA.hide();
this.shapeModelB.hide();
this.shapeModelC.hide();
} else {
if (this.model.switchFaultCode && (fault === 'SPLIT' || fault === 'SQUEEZE' || (fault === 'NORMAL_SPLIT' && !reversePosition) || (fault === 'REVERSE_SPLIT' && !normalPosition))) {
// (fault === 'SPLIT' || fault === 'SQUEEZE' || (fault === 'NORMAL_SPLIT' && !reversePosition) || (fault === 'REVERSE_SPLIT' && !normalPosition))
if (this.model.switchFaultCode && (pos == 'NO' || pos == 'EX') ) {
const switchFault = this.mapDevice[this.model.switchFaultCode];
switchFault.instance.setControlColor('#F00', true);
} else if (this.model.switchFaultCode) {
@ -487,7 +489,7 @@ export default class Switch extends Group {
}
/** 单锁*/
setMonolock(normalPosition, reversePosition) {
setMonolock(pos) {
if (this.style.Switch.rectLock &&
this.style.Switch.rectLock.monolock) { // 判断单锁矩形是否显示
this.lockRect.show();
@ -503,9 +505,9 @@ export default class Switch extends Group {
if (this.style.Switch.arcBlcok &&
this.style.Switch.arcBlcok.show) { // 圆形单锁是否显示
this.lockArc.show();
if (normalPosition) {
if (pos == 'N') {
this.lockArc.setStyle({ stroke: this.style.Switch.arcBlcok.locationColor });
} else if (reversePosition) {
} else if (pos == 'R') {
this.lockArc.setStyle({ stroke: this.style.Switch.arcBlcok.inversionColor });
}
}
@ -513,7 +515,7 @@ export default class Switch extends Group {
}
/** 封锁 */
block(normalPosition, reversePosition) {
block(pos) {
if (this.style.Switch.jointImg.block) { // 宁波专用封锁显示
this.shapeModelB.show();
this.shapeModelB.animateStyle(item => {
@ -547,10 +549,10 @@ export default class Switch extends Group {
this.setTextColor(this.style.Switch.text.blockText);
}
if (this.style.Switch.jointImg.trapezoidBlock) { // 范围且封锁时显示
if (normalPosition) {
if ( pos == 'N') {
this.shapeModelB.show();
this.shapeModelB.setColor('#000080');
} else if (reversePosition) {
} else if ( pos == 'R') {
this.shapeModelA.show();
this.shapeModelA.setColor('#000080');
}
@ -600,11 +602,11 @@ export default class Switch extends Group {
// 处理岔芯颜色
setSectionState(state) {
const sectionC = this.mapDevice[state.sectionCCode];
if (sectionC && state.reversePosition && !state.blockade) {
if (sectionC && state.pos == 'R' & !state.blockade) {
this.setSwitchModelStatus(this.shapeModelA, sectionC);
}
const sectionA = this.mapDevice[state.sectionACode];
if (sectionA && state.normalPosition && !this.style.Switch.core.graphShow && !state.blockade) {
if (sectionA && state.pos == 'N' && !this.style.Switch.core.graphShow && !state.blockade) {
this.setSwitchModelStatus(this.shapeModelB, sectionA);
}
}
@ -650,23 +652,23 @@ export default class Switch extends Group {
this.shapeModelC.setColor('#7F7F7F');
this.name.getNameText().setStyle({textFill: '#7F7F7F'});
}
preReset(normalPosition, reversePosition ) {
preReset(pos) {
const coverBlock = this.style.Switch.coverBlock;
if (coverBlock && coverBlock.preResetColor) { // 范围且封锁时显示
if (normalPosition) {
if (pos == 'N') {
this.shapeModelB.show();
this.shapeModelB.setColor(coverBlock.preResetColor);
} else if (reversePosition) {
} else if (pos == 'R') {
this.shapeModelA.show();
this.shapeModelA.setColor(coverBlock.preResetColor);
}
} else {
const sectionReset = this.style.Section.sectionMiddle;
if (sectionReset && sectionReset.preResetColor) {
if (normalPosition) {
if (pos == 'N') {
this.shapeModelB.show();
this.shapeModelB.setColor(sectionReset.preResetColor);
} else if (reversePosition) {
} else if (pos == 'R') {
this.shapeModelA.show();
this.shapeModelA.setColor(sectionReset.preResetColor);
}
@ -678,13 +680,13 @@ export default class Switch extends Group {
this.recover();
// 只响应前端自定义类型的状态变化
if (model._free) {
if (model.normalPosition) {
if (model.pos == 'N') {
this.switchPosition = 'normal';
this.setLocationAction(model); /** 定位*/
if (model.routeLock) {
this.setSectionState(model);
}
} else if (model.reversePosition) {
} else if (model.pos == 'R') {
this.switchPosition = 'reverse';
this.setInversionAction(model); /** 反位*/
if (model.routeLock) {
@ -694,23 +696,26 @@ export default class Switch extends Group {
this.setAshShow();
}
} else {
this.setSwitchFault(model.fault, model.normalPosition, model.reversePosition);
if (model.normalPosition) {
this.setSwitchFault(model.fault, model.pos);
// model.pos == 'NO' || model.pos == 'EX';
// N-定位 R-反位 NO-无(失表) EX-挤叉
if (model.pos == 'N') {
this.switchPosition = 'normal';
this.setLocationAction(model); /** 定位*/
} else if (model.reversePosition) {
} else if (model.pos == 'R') {
this.switchPosition = 'reverse';
this.setInversionAction(model); /** 反位*/
} else {
} else if (model.pos == 'NO') {
this.setLossAction(model.fault); // 失去
if (model.switchSplit) {
this.setForkAction();
}
} else if (model.pos == 'EX') {
this.setForkAction(); // 挤岔
}
model.isCiConfirm && this.setCiConfirm(); // 道岔使能显示
model.singleLock && this.setMonolock(model.normalPosition, model.reversePosition); // 道岔单锁
model.blockade && this.block(model.normalPosition, model.reversePosition); // 道岔封锁
model.singleLock && this.setMonolock(model.pos); // 道岔单锁
model.blockade && this.block(model.pos); // 道岔封锁
model.singleLock && model.blockade && this.blockMonolock(); // 单锁&锁闭状态
const path = window.location.href;
if (!path.includes('/map/draw')) {
@ -720,7 +725,7 @@ export default class Switch extends Group {
model.routeLock && this.handleRouteLock(); // 道岔进路锁闭
model.overlapLock && this.handleOverlapLock(); // 道岔进路延续保护
// this.interlockingReserved(); // 联锁预留道岔
model.preReset && this.preReset(model.normalPosition, model.reversePosition); // 道岔预复位
model.preReset && this.preReset(model.pos); // 道岔预复位
if (this.style.Switch.sectionAction.flag && this.model.showMode !== '05') { // 哈尔滨线路处理道岔相关区段颜色
const switchModel = this.mapDevice[model.code];

View File

@ -173,14 +173,14 @@ export default {
switch (buttonOperation) {
case OperationEvent.Switch.locate.button.operation: {
//
if (!selectType.normalPosition && selectType.reversePosition) {
if (selectType.pos == 'R') {
this.locate(selectType);
}
break;
}
case OperationEvent.Switch.reverse.button.operation: {
//
if (selectType.normalPosition && !selectType.reversePosition) {
if (selectType.pos == 'N') {
this.reverse(selectType);
}
break;

View File

@ -146,7 +146,7 @@ export default {
}
},
'$store.state.menuOperation.selectedCount': function(val) {
if (this.buttonOperation && this.$store.state.menuOperation.selected._type == 'Switch') {
if (this.buttonOperation && this.$store.state.menuOperation.selected._type == 'Section') {
this.operationHandler(this.buttonOperation, this.$store.state.menuOperation.selected);
}
}
@ -193,19 +193,32 @@ export default {
}
},
operationHandler(buttonOperation, selectType) {
debugger;
switch (buttonOperation) {
case OperationEvent.Section.fault.button.operation: {
//
if (!selectType.normalPosition && selectType.reversePosition) {
this.locate(selectType);
debugger;
commitOperate(menuOperate.Section.fault, {sectionCode:selectType.code}, 3).then(({valid, operate})=>{
if (valid) {
// this.$refs.sectionUnLock.doShow(operate, this.selected);
}
}).catch(error=>{
console.log(error);
this.$refs.noticeInfo.doShow();
});
break;
}
case OperationEvent.Section.axlePreReset.button.operation: {
//
if (selectType.normalPosition && !selectType.reversePosition) {
this.reverse(selectType);
debugger;
commitOperate(menuOperate.Section.axlePreReset, {sectionCode:selectType.code}, 3).then(({valid, operate})=>{
if (valid) {
// this.$refs.sectionUnLock.doShow(operate, this.selected);
}
}).catch(error=>{
console.log(error);
this.$refs.noticeInfo.doShow();
});
break;
}
}

View File

@ -213,14 +213,14 @@ export default {
switch (buttonOperation) {
case OperationEvent.Switch.locate.button.operation: {
//
if (!selectType.normalPosition && selectType.reversePosition) {
if (selectType.pos == 'R') {
this.locate(selectType);
}
break;
}
case OperationEvent.Switch.reverse.button.operation: {
//
if (selectType.normalPosition && !selectType.reversePosition) {
if (selectType.pos == 'N') {
this.reverse(selectType);
}
break;

View File

@ -33,7 +33,7 @@
</el-row>
</el-col>
<el-col v-show="showExpand" :span="showExpand? 18: 0">
<map-visual ref="map" :mapData="mapData" :width="780" :height="600" />
<map-visual ref="map" :map-data="mapData" :width="780" :height="600" />
</el-col>
</el-row>
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
@ -99,7 +99,7 @@ export default {
return '进路设置';
},
expandTitle() {
return this.showExpand? '收起进路预览' : '展开进路预览'
return this.showExpand ? '收起进路预览' : '展开进路预览';
},
commitDisabled() {
let disabled = true;
@ -183,8 +183,8 @@ export default {
if (this.beforeSwitchList && this.beforeSwitchList.length) {
this.beforeSwitchList.forEach(el => {
el.normalPosition = false;
el.reversePosition = false;
// N- R- NO-() EX-
el.pos = 'NO';
el.routeLock = false;
});
}
@ -208,7 +208,7 @@ export default {
const signalEnd = this.$refs.map.getDeviceByCode(row.endSignalCode);
const diff = signalBegin.position.x - signalEnd.position.x;
const code = diff > 0 ? row.endSignalCode : row.startSignalCode;
const signal = diff > 0? signalEnd: signalBegin;
const signal = diff > 0 ? signalEnd : signalBegin;
const switchCodeList = [];
this.$refs.map.setCenterWithOffset(code, 50, signal.position.y);
@ -235,7 +235,8 @@ export default {
const sectionA = this.$refs.map.getDeviceByCode(swch.sectionACode);
const sectionB = this.$refs.map.getDeviceByCode(swch.sectionBCode);
const sectionC = this.$refs.map.getDeviceByCode(swch.sectionCCode);
containSwitchList.push({code: el.switchCode, routeLock: true, normalPosition: el.normal, reversePosition: !el.normal});
// normalPosition: el.normal, reversePosition: !el.normal
containSwitchList.push({code: el.switchCode, routeLock: true, pos:el.pos });
if (el.normal) {
containSectionList.push({code: sectionA.code, routeLock:true });
containSectionList.push({code: sectionC.code, preBlue: true });

View File

@ -36,8 +36,8 @@
</div>
<div class="radio-box-title">设置位置</div>
<div class="radio-box">
<el-radio v-model="position" label="normal" :disabled="!!(selectedSwitch.normalPosition || selectedSwitch.auto)" style="display: block;margin-bottom: 10px;">定位</el-radio>
<el-radio v-model="position" label="reserve" :disabled="!!(selectedSwitch.reversePosition || selectedSwitch.auto)" style="display: block;">反位</el-radio>
<el-radio v-model="position" label="normal" :disabled="!!(selectedSwitch.pos=='N' || selectedSwitch.auto)" style="display: block;margin-bottom: 10px;">定位</el-radio>
<el-radio v-model="position" label="reserve" :disabled="!!(selectedSwitch.pos=='R' || selectedSwitch.auto)" style="display: block;">反位</el-radio>
</div>
<div class="radio-box-title">设置预留</div>
<div class="radio-box">
@ -208,9 +208,10 @@ export default {
},
getSwitchPosition(code) {
const elem = this.$store.getters['map/getDeviceByCode'](code);
if (elem.normalPosition) {
// N- R- NO-() EX-
if (elem.pos == 'N') {
return '定位';
} else if (elem.reversePosition) {
} else if (elem.pos == 'R') {
return '反位';
} else {
return '';

View File

@ -109,9 +109,10 @@ export default {
},
getSwitchPosition(code) {
const elem = this.$store.getters['map/getDeviceByCode'](code);
if (elem.normalPosition) {
// N- R- NO-() EX-
if (elem.pos == 'N') {
return '定位';
} else if (elem.reversePosition) {
} else if (elem.pos == 'R') {
return '反位';
} else {
return '';

View File

@ -7,24 +7,16 @@ export default function parseStatus(deviceStatus) {
elem.deviceType = deviceType.Switch;
switch (msg[1]) {
case 0:
elem.normalPosition = 0;
elem.reversePosition = 0;
elem.switchSplit = 0;
elem.pos = 'NO'; // 失表
break;
case 1:
elem.normalPosition = 1;
elem.reversePosition = 0;
elem.switchSplit = 0;
elem.pos = 'N'; // 定位
break;
case 2:
elem.normalPosition = 0;
elem.reversePosition = 1;
elem.switchSplit = 0;
elem.pos = 'R'; // 反位
break;
case 4:
elem.normalPosition = 0;
elem.reversePosition = 0;
elem.switchSplit = 1;
elem.pos = 'EX'; // 挤岔
break;
}
elem.blockade = msg[2];

View File

@ -77,7 +77,8 @@ export default {
x: skew.x,
y: skew.y
},
normalPosition: 1 //
pos: 'N' //
// N- R- NO-() EX-
};
const model = Object.assign(switchModel, data);
const swch = this.findSwitchData(model.sectionACode, model.sectionBCode, model.sectionCCode);
@ -135,7 +136,8 @@ export default {
x: skew.x,
y: skew.y
},
normalPosition: 1 //
pos: 'N' //
// N- R- NO-() EX-
};
const model = Object.assign(switchModel, data);
const swch = this.findSwitchData(model.sectionACode, model.sectionBCode, model.sectionCCode);