增加西安二号线折返策略配置,增加联锁配置

This commit is contained in:
zyy 2020-08-24 11:30:57 +08:00
parent f8d3ffa91d
commit b262288524
5 changed files with 235 additions and 28 deletions

View File

@ -438,6 +438,27 @@ class SkinCode extends defaultStyle {
}
};
this[deviceType.StationTurnBack] = { // 站后折返
displayCondition: '01', // 显示条件 01所有模式下显示 02 行调显示 03现地显示
spliceShow: true, // 西安二号线特殊显示
lamp: {
fill: '#FFFF00', // 填充色
radiusR: 6 // 控制灯大小
},
text: {
titleTextShow: false,
fontWeight: 580,
fontSize: 12,
distance: 10
},
rect: {
fill: 'rgba(0,0,0,0)',
stroke: '#fff',
lineWidth: 2,
padding: 6
}
};
this[deviceType.Switch] = {
text: {
show: true, // 道岔名称显示
@ -631,7 +652,8 @@ class SkinCode extends defaultStyle {
rectWidth: 20, // 折返模块宽度
lineWidth: 3, // 折返模块线宽
fillColor: 'rgba(0,0,0,0)', // 填充色
strokeColor: '#9F9C9C' // 线颜色
strokeColor: '#9F9C9C', // 线颜色
highlightColor: '#fff' // 高亮颜色
};
this[deviceType.ModeStatusGroup] = { // 车站状态模式
displayCondition: '01', // 显示条件 01所有模式下显示 02 行调显示 03现地显示

View File

@ -0,0 +1,141 @@
import Group from 'zrender/src/container/Group';
import Rect from 'zrender/src/graphic/shape/Rect';
import Line from 'zrender/src/graphic/shape/Line';
export default class EFoldbackMode extends Group {
constructor(model) {
super();
this.model = model;
this.zlevel = model.zlevel;
this._subType = model._subType;
this.z = model.z;
this.onmouseover = model.mouseover;
this.onmouseout = model.mouseout;
this.create(model);
}
create(model) {
const style = model.style;
this.lateralLinePriorityRect = new Rect({
zlevel: this.zlevel,
z: this.z,
shape: {
x: model.x,
y: model.y,
width: model.width,
height:model.width
},
style: {
lineWidth: style.ReturnModeGroup.lineWidth,
stroke: style.ReturnModeGroup.strokeColor,
fill: style.ReturnModeGroup.fillColor
}
});
this.lateralLinePriority1 = new Line({
zlevel: model.zlevel,
z: model.z,
shape: {
x1: model.x + model.style.ReturnModeGroup.insideDistance,
y1: model.y + model.style.ReturnModeGroup.insideDistance,
x2: model.x + model.width - style.ReturnModeGroup.insideDistance,
y2: model.y + model.width - style.ReturnModeGroup.insideDistance
},
style: {
lineWidth: model.style.ReturnModeGroup.lineWidth,
stroke: model.style.ReturnModeGroup.strokeColor
}
});
this.lateralLinePriority2 = new Line({
zlevel: model.zlevel,
z: model.z,
shape: {
x1: model.x + model.width - style.ReturnModeGroup.insideDistance,
y1: model.y + style.ReturnModeGroup.insideDistance,
x2: model.x + style.ReturnModeGroup.insideDistance,
y2: model.y + model.width - style.ReturnModeGroup.insideDistance
},
style: {
lineWidth: style.ReturnModeGroup.lineWidth,
stroke: style.ReturnModeGroup.strokeColor
}
});
this.add(this.lateralLinePriorityRect);
this.add(this.lateralLinePriority1);
this.add(this.lateralLinePriority2);
this.linearFoldbackRect = new Rect({
zlevel: this.zlevel,
z: this.z,
shape: {
x: model.x + model.width + style.ReturnModeGroup.outsideDistance,
y: model.y,
width: model.width,
height:model.width
},
style: {
lineWidth: style.ReturnModeGroup.lineWidth,
stroke: style.ReturnModeGroup.strokeColor,
fill: style.ReturnModeGroup.fillColor
}
});
this.linearFoldback = new Line({
zlevel: model.zlevel,
z: model.z,
shape: {
x1: model.x + model.width + style.ReturnModeGroup.outsideDistance + style.ReturnModeGroup.insideDistance,
y1: model.y + model.width / 2,
x2: model.x + model.width * 2 + style.ReturnModeGroup.outsideDistance - style.ReturnModeGroup.insideDistance,
y2: model.y + model.width / 2
},
style: {
lineWidth: style.ReturnModeGroup.lineWidth,
stroke: style.ReturnModeGroup.strokeColor
}
});
this.add(this.linearFoldbackRect);
this.add(this.linearFoldback);
this.lateralLineRect = new Rect({
zlevel: this.zlevel,
z: this.z,
shape: {
x: model.x + model.width * 2 + style.ReturnModeGroup.outsideDistance * 2,
y: model.y,
width: model.width,
height:model.width
},
style: {
lineWidth: style.ReturnModeGroup.lineWidth,
stroke: style.ReturnModeGroup.strokeColor,
fill: style.ReturnModeGroup.fillColor
}
});
this.lateralLine = new Line({
zlevel: model.zlevel,
z: model.z,
shape: {
x1: model.x + model.width * 2 + style.ReturnModeGroup.outsideDistance * 2 + style.ReturnModeGroup.insideDistance,
y1: model.y + model.width - style.ReturnModeGroup.insideDistance,
x2: model.x + model.width * 3 + style.ReturnModeGroup.outsideDistance * 2 - style.ReturnModeGroup.insideDistance,
y2: model.y + style.ReturnModeGroup.insideDistance
},
style: {
lineWidth: style.ReturnModeGroup.lineWidth,
stroke: style.ReturnModeGroup.strokeColor
}
});
this.add(this.lateralLineRect);
this.add(this.lateralLine);
}
highlightType1(color) {
this.lateralLinePriorityRect && this.lateralLinePriorityRect.setStyle('stroke', color);
this.lateralLinePriority1 && this.lateralLinePriority1.setStyle('stroke', color);
this.lateralLinePriority2 && this.lateralLinePriority2.setStyle('stroke', color);
}
highlightType2(color) {
this.linearFoldbackRect && this.linearFoldbackRect.setStyle('stroke', color);
this.linearFoldback && this.linearFoldback.setStyle('stroke', color);
}
highlightType3(color) {
this.lateralLineRect && this.lateralLineRect.setStyle('stroke', color);
this.lateralLine && this.lateralLine.setStyle('stroke', color);
}
}

View File

@ -2,6 +2,7 @@ import Group from 'zrender/src/container/Group';
import Circle from 'zrender/src/graphic/shape/Circle';
import Text from 'zrender/src/graphic/Text';
import Rect from 'zrender/src/graphic/shape/Rect';
import EFoldbackMode from './EFoldbackMode';
import Vue from 'vue';
export default class StationTurnBack extends Group {
@ -22,7 +23,7 @@ export default class StationTurnBack extends Group {
const model = this.model;
const style = this.style;
if (model.show) {
if (model.show && !style.StationTurnBack.spliceShow) {
this.control = new Circle({
zlevel: this.zlevel,
z: this.z,
@ -95,18 +96,34 @@ export default class StationTurnBack extends Group {
this.add(this.text);
this.add(this.strategyText);
}
if (style.StationTurnBack.spliceShow) {
this.control = new EFoldbackMode({
zlevel: this.zlevel,
z: this.z,
x: model.position.x,
y: model.position.y,
width: style.ReturnModeGroup.rectWidth,
style: style
});
this.add(this.control);
}
}
recover() {
const path = window.location.href;
if (!path.includes('/map/draw')) {
this.strategyText.hide();
this.strategyText && this.strategyText.hide();
}
this.control && this.control.highlightType1(this.style.ReturnModeGroup.highlightColor);
// this.control && this.control.highlightType1(this.style.ReturnModeGroup.strokeColor);
this.control && this.control.highlightType2(this.style.ReturnModeGroup.strokeColor);
this.control && this.control.highlightType3(this.style.ReturnModeGroup.strokeColor);
}
handleStatus(name) {
this.strategyText.show();
this.strategyText.attr({
this.strategyText && this.strategyText.show();
this.strategyText && this.strategyText.attr({
style: {
text: name
}
@ -125,7 +142,6 @@ export default class StationTurnBack extends Group {
}
});
}
// console.log(model, '站后折返model');
}
setShowMode() {
@ -142,8 +158,6 @@ export default class StationTurnBack extends Group {
this.eachChild(item => {
item.show();
});
// this.isShowShape = true;
// this.setState(this.model);
} else {
this.eachChild(item => {
item.hide();

View File

@ -86,6 +86,7 @@ export default {
generateCycle: false,
routeButton: false,
likeHa1: false,
getNearlySignal: false,
overlapSettingByTrigger: false,
overlapReleaseTime: 45,
routeReleaseTime: 60
@ -94,7 +95,7 @@ export default {
focus: false,
booleanList: ['upRight', 'lockFirst', 'switchSingleHandle', 'signalApproachOnlyOne', 'signalApproachOnlyNpSwitch',
'routeNameUseEndOppositeSignalName', 'generateTbRoute', 'tbRouteNameUseEndOppositeSignalName', 'routeSignalAlwaysGreen',
'routeApartByOverlap', 'overlapOnlySwitch', 'overlapSwitchNpOnly', 'overlapSignalOppositeSwitchNpOnly', 'overlapOnlyOneSwitch', 'generateCycle', 'routeButton', 'likeHa1', 'overlapSettingByTrigger', 'generateFls'],
'routeApartByOverlap', 'overlapOnlySwitch', 'overlapSwitchNpOnly', 'overlapSignalOppositeSwitchNpOnly', 'overlapOnlyOneSwitch', 'generateCycle', 'routeButton', 'likeHa1', 'getNearlySignal', 'overlapSettingByTrigger', 'generateFls'],
selectList: [],
numberList: ['overlapReleaseTime', 'routeReleaseTime'],
optionsMap: {
@ -120,6 +121,7 @@ export default {
generateCycle: '是否生成自动折返',
routeButton: '是否生成进路结束按钮',
likeHa1: '是否类似哈尔滨一号线联锁分为ATP信号、地面信号、引导信号',
getNearlySignal: '生成进路信号按钮,进路信号按钮是否取最近的一个信号机',
overlapSettingByTrigger: '延续保护的建立方式:是-通过触发建立,否-随进路建立',
generateFls: '是否生成侧防:是-生成侧防,不要联动道岔,否-不生成侧防,用联动道岔'
}

View File

@ -3,13 +3,18 @@
<el-tab-pane class="view-control" :label="$t('map.property')" name="first" :lazy="lazy">
<div class="view-control-content">
<config-list ref="dataform" :form="form" :form-model="editModel" :rules="rules">
<div v-if="editModel.type == 'StationTurnBack'" class="card-box">
<div class="card_title">站后折返数据</div>
<fieldset v-if="editModel.type == 'StationTurnBack'" class="card-box">
<legend class="card_title">站后折返数据</legend>
<div>
<el-table :data="editModel.optionList" border style="width: 100%">
<el-table-column prop="id" label="编号" width="100px" />
<el-table-column prop="label" label="描述" width="250px" />
<el-table-column fixed="right" label="操作">
<el-table-column prop="id" label="编号" width="50px" />
<el-table-column prop="label" label="描述" />
<el-table-column label="配置默认" width="100px">
<template slot-scope="scope">
<el-checkbox @click.native.prevent="checkOverlab(editModel.optionList, scope.$index)" v-model="scope.row.checked"></el-checkbox>
</template>
</el-table-column>
<el-table-column label="操作" width="100px">
<template slot-scope="scope">
<el-button type="text" size="small" @click.native.prevent="deleteOverlab(editModel.optionList, scope.$index)">移出</el-button>
<el-button type="text" size="small" @click.native.prevent="editOverlab(editModel.optionList, scope.$index)">编辑</el-button>
@ -45,7 +50,7 @@
</div>
</el-card>
</div>
</div>
</fieldset>
</config-list>
</div>
<div class="button_box">
@ -123,6 +128,7 @@ export default {
name: '',
show: true, //
subtitleName: '',
initId: '',
optionList: [], //
automaticRouteCode: '', // code
cycleCode: '', // code
@ -311,6 +317,7 @@ export default {
type: '',
name: '',
show: true, //
initId: '',
subtitleName: '',
optionList: [], //
automaticRouteCode: '', // code
@ -381,6 +388,12 @@ export default {
this.$refs.dataform && this.$refs.dataform.resetFields();
this.$refs.make && this.$refs.make.resetFields();
this.activeName = 'first';
selected.optionList.forEach(item => {
item.checked = false;
if (item.id == selected.initId) {
item.checked = true;
}
});
this.editModel = deepAssign(this.editModel, selected);
this.editModel.type = selected._type;
this.$nextTick(() => {
@ -442,6 +455,7 @@ export default {
this.$refs['dataform'].validate((valid) => {
if (valid) {
const data = Object.assign({_type: this.editModel.type}, this.editModel);
console.log(data, '=====');
this.$emit('updateMapModel', data);
}
});
@ -470,6 +484,17 @@ export default {
this.$emit('deviceSelect', '');
}
},
checkOverlab(list, index) {
list.forEach((item, i) => {
if (i != index) {
item.checked = false;
}
})
list[index].checked = !list[index].checked;
if (list[index].checked) {
this.editModel.initId = list[index].id;
}
},
deleteOverlab(list, index) {
list.splice(index, 1);
this.cardMode = 'generate';
@ -486,6 +511,7 @@ export default {
id: this.addBackModel.id,
type: this.addBackModel.type,
label: this.addBackModel.label,
checked: false,
sectionList: this.addBackModel.type == 'NONE' ? [] : this.addBackModel.sectionList
};
this.editModel.optionList.splice(this.addBackModel.parentIndex, 1, data);
@ -503,6 +529,7 @@ export default {
id: id,
type: this.addBackModel.type,
label: this.addBackModel.label,
checked: false,
sectionList: this.addBackModel.type == 'NONE' ? [] : this.addBackModel.sectionList
});
this.$refs.hostileForm.resetFields();
@ -559,6 +586,7 @@ export default {
box-sizing: border-box;
position: relative;
margin-bottom: 15px;
margin-top: 15px;
&:last-child{
margin-bottom: 0;