调整区段流程逻辑,站台流程
This commit is contained in:
parent
dd9080c0d0
commit
ad6b8f8dba
@ -30,17 +30,6 @@ class SkinCode extends defaultStyle {
|
||||
textPosition: 'inside', // 文字位置
|
||||
textVerticalAlign: 'middle' // 文字垂直对齐方式
|
||||
},
|
||||
switchText: {
|
||||
show: false, // 道岔区段名称显示
|
||||
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
|
||||
distance: 18, // 文字离区段距离
|
||||
fontSize: 11, // 字体大小
|
||||
fontWeight: 'normal', // 字体粗细
|
||||
fontColor: '#FFFFFF', // 字体颜色
|
||||
textAlign: 'center', // 水平对齐方式
|
||||
textPosition: 'inside', // 文字位置
|
||||
textVerticalAlign: 'middle' // 文字垂直对齐方式
|
||||
},
|
||||
standText: { // 站台轨名称
|
||||
show: true, // 站台轨名称显示
|
||||
opposite: true, // 对称相反
|
||||
|
@ -30,17 +30,6 @@ class SkinCode extends defaultStyle {
|
||||
textPosition: 'inside', // 文字位置
|
||||
textVerticalAlign: 'middle' // 文字垂直对齐方式
|
||||
},
|
||||
switchText: {
|
||||
show: false, // 道岔区段名称显示
|
||||
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
|
||||
distance: 18, // 文字离区段距离
|
||||
fontSize: 11, // 字体大小
|
||||
fontWeight: 'normal', // 字体粗细
|
||||
fontColor: '#FFFFFF', // 字体颜色
|
||||
textAlign: 'center', // 水平对齐方式
|
||||
textPosition: 'inside', // 文字位置
|
||||
textVerticalAlign: 'middle' // 文字垂直对齐方式
|
||||
},
|
||||
standText: { // 站台
|
||||
show: true, // 站台轨名称显示
|
||||
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
|
||||
|
@ -30,17 +30,6 @@ class SkinCode extends defaultStyle {
|
||||
textPosition: 'inside', // 文字位置
|
||||
textVerticalAlign: 'middle' // 文字垂直对齐方式
|
||||
},
|
||||
switchText: {
|
||||
show: false, // 道岔区段名称显示
|
||||
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
|
||||
distance: 18, // 文字离区段距离
|
||||
fontSize: 11, // 字体大小
|
||||
fontWeight: 'normal', // 字体粗细
|
||||
fontColor: '#FFFFFF', // 字体颜色
|
||||
textAlign: 'center', // 水平对齐方式
|
||||
textPosition: 'inside', // 文字位置
|
||||
textVerticalAlign: 'middle' // 文字垂直对齐方式
|
||||
},
|
||||
standText: {
|
||||
show: true, // 站台轨名称显示
|
||||
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
|
||||
|
@ -30,17 +30,6 @@ class SkinCode extends defaultStyle {
|
||||
textPosition: 'inside', // 文字位置
|
||||
textVerticalAlign: 'middle' // 文字垂直对齐方式
|
||||
},
|
||||
switchText: {
|
||||
show: false, // 道岔区段名称显示
|
||||
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
|
||||
distance: 18, // 文字离区段距离
|
||||
fontSize: 11, // 字体大小
|
||||
fontWeight: 'normal', // 字体粗细
|
||||
fontColor: '#FFFFFF', // 字体颜色
|
||||
textAlign: 'center', // 水平对齐方式
|
||||
textPosition: 'inside', // 文字位置
|
||||
textVerticalAlign: 'middle' // 文字垂直对齐方式
|
||||
},
|
||||
standText: {
|
||||
show: true, // 站台轨名称显示
|
||||
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
|
||||
|
@ -30,17 +30,6 @@ class SkinCode extends defaultStyle {
|
||||
textPosition: 'inside', // 文字位置
|
||||
textVerticalAlign: 'middle' // 文字垂直对齐方式
|
||||
},
|
||||
switchText: {
|
||||
show: false, // 道岔区段名称显示
|
||||
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
|
||||
distance: 18, // 文字离区段距离
|
||||
fontSize: 11, // 字体大小
|
||||
fontWeight: 'normal', // 字体粗细
|
||||
fontColor: '#FFFFFF', // 字体颜色
|
||||
textAlign: 'center', // 水平对齐方式
|
||||
textPosition: 'inside', // 文字位置
|
||||
textVerticalAlign: 'middle' // 文字垂直对齐方式
|
||||
},
|
||||
standText: {
|
||||
show: true, // 站台轨名称显示
|
||||
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
|
||||
|
@ -30,17 +30,6 @@ class SkinCode extends defaultStyle {
|
||||
textPosition: 'inside', // 文字位置
|
||||
textVerticalAlign: 'middle' // 文字垂直对齐方式
|
||||
},
|
||||
switchText: {
|
||||
show: false, // 道岔区段名称显示
|
||||
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
|
||||
distance: 18, // 文字离区段距离
|
||||
fontSize: 11, // 字体大小
|
||||
fontWeight: 'normal', // 字体粗细
|
||||
fontColor: '#FFFFFF', // 字体颜色
|
||||
textAlign: 'center', // 水平对齐方式
|
||||
textPosition: 'inside', // 文字位置
|
||||
textVerticalAlign: 'middle' // 文字垂直对齐方式
|
||||
},
|
||||
standText: { // 站台
|
||||
show: true, // 站台轨名称显示
|
||||
position: 0, // 区段名称位置 1 上面 -1 下面 0 对称
|
||||
|
@ -12,7 +12,6 @@ deviceState[deviceType.Section] = {
|
||||
cutOff: 0, // 是否切除
|
||||
invalid: 0, // 是否失效
|
||||
speedUpLimit: 0, // 最高限速
|
||||
/** 是否故障*/
|
||||
fault: 0 /** 非故障*/
|
||||
};
|
||||
// 进路后端状态
|
||||
|
@ -6,7 +6,7 @@ import ELines from './ELines'; // 创建多线条 曲线 (私有)
|
||||
import EblockLines from './EblockLines'; // 区段封锁特有
|
||||
import ESeparator from './ESeparator'; // 分隔符 (私有)
|
||||
import EMouse from './EMouse';
|
||||
import { EAxle } from './EAxle'; // 创建计轴 (私有)
|
||||
// import { EAxle } from './EAxle'; // 创建计轴 (暂时不使用)
|
||||
import { EBackArrow, EBackArrowTriangle } from './EBackArrow'; // 折返进路箭头
|
||||
import ELimitName from './ELimitName'; // 成都三号线 限速名称
|
||||
import JTriangle from '../../utils/JTriangle';
|
||||
@ -33,211 +33,12 @@ export default class Section extends Group {
|
||||
}
|
||||
|
||||
create() {
|
||||
const model = this.model;
|
||||
// 01:计轴区段;02逻辑区段;03道岔区段 04道岔计轴区段
|
||||
// 区段type 01计轴区段;02逻辑区段;03道岔区段 04道岔计轴区段
|
||||
this.createSectionText(); // 创建区段文字
|
||||
// if ((model.type === '01' || model.type === '03') && (
|
||||
// model.logicSectionNum.length <= 0 ||
|
||||
// model.logicSectionNum.length == 1 && model.logicSectionNum[0] == 0) ||
|
||||
// model.type === '02') {
|
||||
// if (model.type === '01' || model.type === '03') {
|
||||
this.createSection(); // 创建区段
|
||||
this.creatRelease(); // 创建延时释放
|
||||
this.createSeparator(); // 创建分隔符
|
||||
this.createTurnBack(); // 创建成都三号线 折返箭头
|
||||
if (model.type === '01' && model.type === '03') {
|
||||
this.createAxles(); // 创建计轴
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
/** 创建区段*/
|
||||
createSection() {
|
||||
const model = this.model;
|
||||
const style = this.style;
|
||||
// 创建区段
|
||||
this.section = new ELines({
|
||||
zlevel: this.zlevel,
|
||||
// z: model.type == '02' ? this.z + 1 : this.z, // 逻辑区段层级降低一层
|
||||
z: this.z, // 逻辑区段层级降低一层
|
||||
isSwitchSection: model.switchSection,
|
||||
isCurve: model.curve,
|
||||
points: model.type == '04' ? [model.namePosition, model.namePosition] : model.points,
|
||||
style: style
|
||||
});
|
||||
// 创建哈尔滨特殊区段(用作封锁显示)
|
||||
this.sectionBlock = new EblockLines({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
isSwitchSection: model.switchSection,
|
||||
isCurve: model.curve,
|
||||
points: model.points,
|
||||
style: style
|
||||
});
|
||||
|
||||
this.add(this.section);
|
||||
this.add(this.sectionBlock);
|
||||
|
||||
if (this.style.Section.line.isActiveShow) { // 哈尔滨线路点击背景色
|
||||
this.lineBorder = new ELines({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z - 1, // 逻辑区段层级降低一层
|
||||
isSwitchSection: model.switchSection,
|
||||
isCurve: model.curve,
|
||||
points: model.type == '04' ? [model.namePosition, model.namePosition] : model.points,
|
||||
style: style
|
||||
});
|
||||
this.add(this.lineBorder);
|
||||
this.lineBorder.setStyle({ lineWidth: 0 });
|
||||
}
|
||||
}
|
||||
|
||||
// 折返箭头
|
||||
createTurnBack() {
|
||||
const model = this.model;
|
||||
const style = this.style;
|
||||
if (model.reentryTrack && style.Section.shuttleBack) {
|
||||
const radius = 3;
|
||||
model.drict = 1; // 箭头朝向 (是折返轨加一个方向选择) 目前在区段右边
|
||||
const width = style.Section.line.width * 2;
|
||||
const height = style.Section.line.width * 1;
|
||||
const turnBackDistance = style.Section.shuttleBack.distance + radius * 4;
|
||||
|
||||
const points = model.points;
|
||||
let x = -model.drict * width * 1.2;
|
||||
let y = -turnBackDistance;
|
||||
|
||||
if (model.drict < 0) {
|
||||
x += points[0].x;
|
||||
y += points[0].y;
|
||||
} else {
|
||||
x += points[points.length - 1].x;
|
||||
y += points[points.length - 1].y;
|
||||
}
|
||||
|
||||
this.turnBack = new EBackArrow({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z + 10,
|
||||
shape: {
|
||||
drict: model.drict,
|
||||
width: width,
|
||||
height: height,
|
||||
points: {
|
||||
x: x,
|
||||
y: y
|
||||
}
|
||||
},
|
||||
style: {
|
||||
lineWidth: style.Section.separator.width,
|
||||
stroke: style.Section.separator.color,
|
||||
fill: 'rgba(0, 0, 0, 0)'
|
||||
}
|
||||
});
|
||||
this.turnBackriangle = new EBackArrowTriangle({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z + 10,
|
||||
shape: {
|
||||
drict: model.drict,
|
||||
width: width,
|
||||
height: height,
|
||||
points: {
|
||||
x: x,
|
||||
y: y
|
||||
}
|
||||
},
|
||||
style: {
|
||||
lineWidth: style.Section.separator.width,
|
||||
stroke: style.Section.separator.color,
|
||||
fill: style.Section.separator.color
|
||||
}
|
||||
});
|
||||
this.add(this.turnBack);
|
||||
this.add(this.turnBackriangle);
|
||||
this.turnBack.hide();
|
||||
this.turnBackriangle.hide();
|
||||
}
|
||||
}
|
||||
|
||||
// 创建延时释放 (需要在创建)
|
||||
creatRelease() {
|
||||
const model = this.model;
|
||||
const style = this.style;
|
||||
const traingle = new JTriangle(model.points[0], model.points[model.points.length - 1]);
|
||||
this.release = new ERelease({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
shape: {
|
||||
x1: model.points[0].x + traingle.getCos(traingle.absz / 3),
|
||||
y1: model.points[0].y + traingle.getSin(traingle.absz / 3),
|
||||
x2: model.points[0].x + traingle.getCos(traingle.absz / 3 * 2),
|
||||
y2: model.points[0].y + traingle.getSin(traingle.absz / 3 * 2)
|
||||
},
|
||||
lineWidth: style.Section.line.width,
|
||||
stroke: style.Section.line.spareColor
|
||||
});
|
||||
|
||||
this.add(this.release);
|
||||
}
|
||||
|
||||
// 创建限速线 (需要在创建)
|
||||
creatSpeedLimit() {
|
||||
const model = this.model;
|
||||
const style = this.style;
|
||||
const traingle = new JTriangle(model.points[0], model.points[model.points.length - 1]);
|
||||
let x = traingle.drictx * (style.Section.speedLimit.distance) * traingle.getSinRate();
|
||||
let y = traingle.dricty * (style.Section.speedLimit.distance) * traingle.getCosRate();
|
||||
if (x == Infinity) { x = 0; }
|
||||
if (y == Infinity) { y = 0; }
|
||||
if (!this.speedLimitLeft && !this.speedLimitRight) {
|
||||
this.speedLimitLeft = new ELimitLines({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
position: [x, -y],
|
||||
style: style,
|
||||
switch: model.switch,
|
||||
code: model.code,
|
||||
isSwitchSection: model.switchSection,
|
||||
relSwitchCode: model.relSwitchCode,
|
||||
isCurve: model.curve, // 是否曲线
|
||||
points: model.points
|
||||
});
|
||||
this.speedLimitRight = new ELimitLines({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
position: [-x, y],
|
||||
style: style,
|
||||
switch: model.switch,
|
||||
code: model.code,
|
||||
isSwitchSection: model.switchSection,
|
||||
relSwitchCode: model.relSwitchCode,
|
||||
isCurve: model.curve, // 是否曲线
|
||||
points: model.points
|
||||
});
|
||||
if (style.Section.speedLimit.nameShow) {
|
||||
// 开头 起点位置
|
||||
this.speedLimitNameLeft = new ELimitName({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z + 10,
|
||||
drict: -1,
|
||||
x: model.points[0].x,
|
||||
y: model.points[0].y - 15,
|
||||
style: style
|
||||
});
|
||||
// 终点位置
|
||||
this.speedLimitNameRight = new ELimitName({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z + 10,
|
||||
drict: 1,
|
||||
x: model.points[model.points.length - 1].x,
|
||||
y: model.points[model.points.length - 1].y - 15,
|
||||
style: style
|
||||
});
|
||||
this.add(this.speedLimitNameLeft);
|
||||
this.add(this.speedLimitNameRight);
|
||||
}
|
||||
}
|
||||
this.add(this.speedLimitLeft);
|
||||
this.add(this.speedLimitRight);
|
||||
}
|
||||
|
||||
// 创建区段名称
|
||||
@ -251,14 +52,11 @@ export default class Section extends Group {
|
||||
const y = Math.min(model.points[0].y, model.points[model.points.length - 1].y) + Math.abs(model.points[model.points.length - 1].y - model.points[0].y) / 2;
|
||||
const traingle = new JTriangle(model.points[0], model.points[model.points.length - 1]);
|
||||
const drict = model.trainPosType != '01' ? 1 : -1;
|
||||
/** 区段名称 (逻辑区段名称 或 物理区段名称 是否显示)*/
|
||||
let tempx = x;
|
||||
let tempy = y;
|
||||
if (model.type == '01') { // 物理区段名称
|
||||
if (style.Section.text.show) {
|
||||
const opposite = style.Section.text.opposite ? -1 : 1;
|
||||
tempx += traingle.getSin(style.Section.text.distance);
|
||||
tempy += traingle.getCos(style.Section.text.distance) * (style.Section.text.position || opposite * drict);
|
||||
const tempx = x + traingle.getSin(style.Section.text.distance);
|
||||
const tempy = y + traingle.getCos(style.Section.text.distance) * (style.Section.text.position || opposite * drict);
|
||||
this.name = new ETextName({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z + 2,
|
||||
@ -280,8 +78,8 @@ export default class Section extends Group {
|
||||
} else if (model.type == '02') { // 逻辑区段
|
||||
if (style.Section.logicText.show) {
|
||||
const opposite = style.Section.logicText.opposite ? -1 : 1;
|
||||
tempx += traingle.getSin(style.Section.logicText.distance);
|
||||
tempy += traingle.getCos(style.Section.logicText.distance) * (style.Section.logicText.position || opposite * drict);
|
||||
const tempx = x + traingle.getSin(style.Section.logicText.distance);
|
||||
const tempy = y + traingle.getCos(style.Section.logicText.distance) * (style.Section.logicText.position || opposite * drict);
|
||||
this.name = new ETextName({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z + 2,
|
||||
@ -300,34 +98,14 @@ export default class Section extends Group {
|
||||
});
|
||||
this.add(this.name);
|
||||
}
|
||||
} else if (model.type == '03') { // 道岔区段
|
||||
if (style.Section.switchText.show) {
|
||||
this.name = new ETextName({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z + 2,
|
||||
style: this.style,
|
||||
silent: false,
|
||||
x: tempx + model.namePosition.x,
|
||||
y: tempy + model.namePosition.y + style.Section.text.distance * drict,
|
||||
fontWeight: style.Section.text.fontWeight,
|
||||
fontSize: style.Section.text.fontSize,
|
||||
fontFamily: style.fontFamily,
|
||||
text: model.name,
|
||||
textFill: style.Section.text.fontColor,
|
||||
textAlign: style.Section.text.textAlign,
|
||||
textPosition: style.Section.text.textPosition,
|
||||
textVerticalAlign: style.Section.text.textVerticalAlign
|
||||
});
|
||||
this.add(this.name);
|
||||
}
|
||||
} else if (model.type == '04') { // 道岔计轴区段名称
|
||||
} else if (model.type == '04') { // 道岔计轴区段
|
||||
this.name = new ETextName({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z + 2,
|
||||
style: this.style,
|
||||
silent: false,
|
||||
x: tempx + model.namePosition.x,
|
||||
y: tempy + model.namePosition.y + style.Section.text.distance * drict,
|
||||
x: x + model.namePosition.x,
|
||||
y: y + model.namePosition.y + style.Section.text.distance * drict,
|
||||
fontWeight: style.Section.text.fontWeight,
|
||||
fontSize: style.Section.text.fontSize,
|
||||
fontFamily: style.fontFamily,
|
||||
@ -434,98 +212,196 @@ export default class Section extends Group {
|
||||
}
|
||||
}
|
||||
|
||||
// 创建计轴 (需要在创建)
|
||||
createAxles() {
|
||||
/** 创建区段*/
|
||||
createSection() {
|
||||
const model = this.model;
|
||||
const style = this.style;
|
||||
// 创建区段
|
||||
this.section = new ELines({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z, // 逻辑区段会覆盖物理区段
|
||||
isSwitchSection: model.switchSection,
|
||||
isCurve: model.curve,
|
||||
points: model.type == '04' ? [model.namePosition, model.namePosition] : model.points,
|
||||
style: style
|
||||
});
|
||||
this.add(this.section);
|
||||
|
||||
/** 创建四个计轴*/
|
||||
let traingle = null;
|
||||
if (model && style && model.axleShow && model.points && model.points.length > 1) {
|
||||
traingle = new JTriangle(model.points[0], model.points[1]);
|
||||
this.lUpAxle = new EAxle({
|
||||
if (this.style.Section.block.special) { // 创建哈尔滨特殊区段(用作封锁显示)
|
||||
this.sectionBlock = new EblockLines({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z + 5, // 层级大于道岔z 否则会压住显示完整
|
||||
shape: {
|
||||
point: {
|
||||
x: model.points[0].x,
|
||||
y: model.points[0].y
|
||||
},
|
||||
drictx: 1,
|
||||
dricty: -1,
|
||||
traingle: traingle,
|
||||
style: style
|
||||
},
|
||||
style: {
|
||||
GBaseLineWidth: 1,
|
||||
stroke: style.Section.axle.color
|
||||
}
|
||||
});
|
||||
this.lBottomAxle = new EAxle({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z + 5, // 层级大于道岔z 否则会压住显示完整
|
||||
shape: {
|
||||
point: {
|
||||
x: model.points[0].x,
|
||||
y: model.points[0].y
|
||||
},
|
||||
drictx: 1,
|
||||
dricty: 1,
|
||||
traingle: traingle,
|
||||
style: style
|
||||
},
|
||||
style: {
|
||||
GBaseLineWidth: 1,
|
||||
stroke: style.Section.axle.color
|
||||
}
|
||||
z: this.z,
|
||||
isSwitchSection: model.switchSection,
|
||||
isCurve: model.curve,
|
||||
points: model.points,
|
||||
style: style
|
||||
});
|
||||
this.add(this.sectionBlock);
|
||||
}
|
||||
|
||||
traingle = new JTriangle(model.points[model.points.length - 2], model.points[model.points.length - 1]);
|
||||
this.rUpAxle = new EAxle({
|
||||
if (this.style.Section.line.isActiveShow) { // 哈尔滨线路点击背景色
|
||||
this.lineBorder = new ELines({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z + 5, // 层级大于道岔z 否则会压住显示完整
|
||||
shape: {
|
||||
point: {
|
||||
x: model.points[model.points.length - 1].x,
|
||||
y: model.points[model.points.length - 1].y
|
||||
},
|
||||
drictx: -1,
|
||||
dricty: -1,
|
||||
traingle: traingle,
|
||||
style: style
|
||||
},
|
||||
style: {
|
||||
GBaseLineWidth: 1,
|
||||
stroke: style.Section.axle.color
|
||||
}
|
||||
z: this.z - 1,
|
||||
isSwitchSection: model.switchSection,
|
||||
isCurve: model.curve,
|
||||
points: model.type == '04' ? [model.namePosition, model.namePosition] : model.points,
|
||||
style: style
|
||||
});
|
||||
this.rBottomAxle = new EAxle({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z + 5, // 层级大于道岔z 否则会压住显示完整
|
||||
shape: {
|
||||
point: {
|
||||
x: model.points[model.points.length - 1].x,
|
||||
y: model.points[model.points.length - 1].y
|
||||
},
|
||||
drictx: -1,
|
||||
dricty: 1,
|
||||
traingle: traingle,
|
||||
style: style
|
||||
},
|
||||
style: {
|
||||
GBaseLineWidth: 1,
|
||||
stroke: style.Section.axle.color
|
||||
}
|
||||
});
|
||||
|
||||
this.add(this.lUpAxle);
|
||||
this.add(this.rUpAxle);
|
||||
this.add(this.lBottomAxle);
|
||||
this.add(this.rBottomAxle);
|
||||
this.add(this.lineBorder);
|
||||
this.lineBorder.setStyle({ lineWidth: 0 });
|
||||
}
|
||||
}
|
||||
|
||||
// 创建分隔符 (内层需要在创建)
|
||||
// 折返箭头
|
||||
createTurnBack() {
|
||||
const model = this.model;
|
||||
const style = this.style;
|
||||
if (model.reentryTrack && style.Section.shuttleBack) {
|
||||
const radius = 3;
|
||||
model.drict = 1; // 箭头朝向 (是折返轨加一个方向选择) 目前在区段右边
|
||||
const width = style.Section.line.width * 2;
|
||||
const height = style.Section.line.width * 1;
|
||||
const turnBackDistance = style.Section.shuttleBack.distance + radius * 4;
|
||||
|
||||
const points = model.points;
|
||||
let x = -model.drict * width * 1.2;
|
||||
let y = -turnBackDistance;
|
||||
|
||||
if (model.drict < 0) {
|
||||
x += points[0].x;
|
||||
y += points[0].y;
|
||||
} else {
|
||||
x += points[points.length - 1].x;
|
||||
y += points[points.length - 1].y;
|
||||
}
|
||||
|
||||
this.turnBack = new EBackArrow({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z + 10,
|
||||
shape: {
|
||||
drict: model.drict,
|
||||
width: width,
|
||||
height: height,
|
||||
points: {
|
||||
x: x,
|
||||
y: y
|
||||
}
|
||||
},
|
||||
style: {
|
||||
lineWidth: style.Section.separator.width,
|
||||
stroke: style.Section.separator.color,
|
||||
fill: 'rgba(0, 0, 0, 0)'
|
||||
}
|
||||
});
|
||||
this.turnBackriangle = new EBackArrowTriangle({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z + 10,
|
||||
shape: {
|
||||
drict: model.drict,
|
||||
width: width,
|
||||
height: height,
|
||||
points: {
|
||||
x: x,
|
||||
y: y
|
||||
}
|
||||
},
|
||||
style: {
|
||||
lineWidth: style.Section.separator.width,
|
||||
stroke: style.Section.separator.color,
|
||||
fill: style.Section.separator.color
|
||||
}
|
||||
});
|
||||
this.add(this.turnBack);
|
||||
this.add(this.turnBackriangle);
|
||||
this.turnBack.hide();
|
||||
this.turnBackriangle.hide();
|
||||
}
|
||||
}
|
||||
|
||||
// 创建延时释放
|
||||
creatRelease() {
|
||||
const model = this.model;
|
||||
const style = this.style;
|
||||
const traingle = new JTriangle(model.points[0], model.points[model.points.length - 1]);
|
||||
this.release = new ERelease({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
shape: {
|
||||
x1: model.points[0].x + traingle.getCos(traingle.absz / 3),
|
||||
y1: model.points[0].y + traingle.getSin(traingle.absz / 3),
|
||||
x2: model.points[0].x + traingle.getCos(traingle.absz / 3 * 2),
|
||||
y2: model.points[0].y + traingle.getSin(traingle.absz / 3 * 2)
|
||||
},
|
||||
lineWidth: style.Section.line.width,
|
||||
stroke: style.Section.line.spareColor
|
||||
});
|
||||
|
||||
this.add(this.release);
|
||||
}
|
||||
|
||||
// 创建限速线
|
||||
creatSpeedLimit() {
|
||||
const model = this.model;
|
||||
const style = this.style;
|
||||
const traingle = new JTriangle(model.points[0], model.points[model.points.length - 1]);
|
||||
let x = traingle.drictx * (style.Section.speedLimit.distance) * traingle.getSinRate();
|
||||
let y = traingle.dricty * (style.Section.speedLimit.distance) * traingle.getCosRate();
|
||||
if (x == Infinity) { x = 0; }
|
||||
if (y == Infinity) { y = 0; }
|
||||
if (!this.speedLimitLeft && !this.speedLimitRight) {
|
||||
this.speedLimitLeft = new ELimitLines({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
position: [x, -y],
|
||||
style: style,
|
||||
switch: model.switch,
|
||||
code: model.code,
|
||||
isSwitchSection: model.switchSection,
|
||||
relSwitchCode: model.relSwitchCode,
|
||||
isCurve: model.curve, // 是否曲线
|
||||
points: model.points
|
||||
});
|
||||
this.speedLimitRight = new ELimitLines({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
position: [-x, y],
|
||||
style: style,
|
||||
switch: model.switch,
|
||||
code: model.code,
|
||||
isSwitchSection: model.switchSection,
|
||||
relSwitchCode: model.relSwitchCode,
|
||||
isCurve: model.curve, // 是否曲线
|
||||
points: model.points
|
||||
});
|
||||
if (style.Section.speedLimit.nameShow) {
|
||||
// 开头 起点位置
|
||||
this.speedLimitNameLeft = new ELimitName({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z + 10,
|
||||
drict: -1,
|
||||
x: model.points[0].x,
|
||||
y: model.points[0].y - 15,
|
||||
style: style
|
||||
});
|
||||
// 终点位置
|
||||
this.speedLimitNameRight = new ELimitName({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z + 10,
|
||||
drict: 1,
|
||||
x: model.points[model.points.length - 1].x,
|
||||
y: model.points[model.points.length - 1].y - 15,
|
||||
style: style
|
||||
});
|
||||
this.add(this.speedLimitNameLeft);
|
||||
this.add(this.speedLimitNameRight);
|
||||
}
|
||||
}
|
||||
this.add(this.speedLimitLeft);
|
||||
this.add(this.speedLimitRight);
|
||||
}
|
||||
|
||||
// 创建分隔符
|
||||
createSeparator() {
|
||||
const model = this.model;
|
||||
const style = this.style;
|
||||
@ -566,14 +442,6 @@ export default class Section extends Group {
|
||||
}
|
||||
}
|
||||
|
||||
/** 设置区段集合显隐*/
|
||||
setInvisible() {
|
||||
const invisible = this.model.type === '02' && this.model.logicSectionShow;
|
||||
this.eachChild((child) => {
|
||||
child.attr('invisible', invisible);
|
||||
});
|
||||
}
|
||||
|
||||
/** 设置区段恢复默认状态*/
|
||||
recover() {
|
||||
if (this.section) {
|
||||
@ -584,10 +452,7 @@ export default class Section extends Group {
|
||||
stroke: this.style.Section.line.spareColor,
|
||||
lineWidth: this.style.Section.line.width
|
||||
});
|
||||
|
||||
if (this.release) {
|
||||
this.release.hide();
|
||||
}
|
||||
this.release && this.release.hide();
|
||||
if (this.speedLimitLeft && this.speedLimitRight) {
|
||||
this.remove(this.speedLimitLeft);
|
||||
this.remove(this.speedLimitRight);
|
||||
@ -705,7 +570,7 @@ export default class Section extends Group {
|
||||
}
|
||||
}
|
||||
|
||||
/** 延时释放 10*/
|
||||
/** 延时释放*/
|
||||
async timeRelease() {
|
||||
this.section.setStyle({
|
||||
stroke: this.style.Section.line.routeLockColor,
|
||||
@ -725,7 +590,7 @@ export default class Section extends Group {
|
||||
}
|
||||
}
|
||||
|
||||
/** 保护区段延时解锁 11*/
|
||||
/** 保护区段延时解锁*/
|
||||
protectiveTimeRelease() {
|
||||
this.section.setStyle({
|
||||
stroke: this.style.Section.line.protectiveLockColor,
|
||||
@ -786,7 +651,7 @@ export default class Section extends Group {
|
||||
setState(model, flag = false) {
|
||||
if (!this.isShowShape) return;
|
||||
this.recover();
|
||||
// 实际上就是 状态重置 必须在设置其他状态之前 设置颜色之类的
|
||||
// 哈尔滨线路 道岔相关区段设置 默认颜色
|
||||
if (this.style.Switch.sectionAction.flag && model.relSwitchCode && !flag) {
|
||||
const switchModel = Vue.prototype.$jlmap.mapDevice[model.relSwitchCode];
|
||||
if (switchModel.normalPosition != 0) { // 定位情况
|
||||
|
@ -223,14 +223,10 @@ class Signal extends Group {
|
||||
}
|
||||
}
|
||||
|
||||
/* count 1单灯 2双灯 正向开放*/
|
||||
/* 正向开放*/
|
||||
openPositive() {
|
||||
// if (this.count == 2) {
|
||||
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.greenColor);
|
||||
this.lamps[1] && this.lamps[1].setColor(this.style.backgroundColor); // 设置黑色
|
||||
// } else if (this.count == 1) {
|
||||
// this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.greenColor);
|
||||
// }
|
||||
this.virtualSignal && this.virtualSignal.setColor(this.style.Signal.lamp.greenColor);
|
||||
if (this.style.Signal.lamp.guidName == 'haerbin_01') { // 设置底座颜色
|
||||
this.sigPost.setColor('#00FF00');
|
||||
@ -239,14 +235,10 @@ class Signal extends Group {
|
||||
}
|
||||
}
|
||||
}
|
||||
/* count 1单灯 2双灯 侧向开放 */
|
||||
/* 侧向开放 */
|
||||
openLateral() {
|
||||
// if (this.count == 2) {
|
||||
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.yellowColor);
|
||||
this.lamps[1] && this.lamps[1].setColor(this.style.backgroundColor);
|
||||
// } else if (this.count == 1) {
|
||||
// this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.yellowColor);
|
||||
// }
|
||||
if (this.style.Signal.lamp.guidName == 'haerbin_01') { // 设置底座颜色
|
||||
this.sigPost.setColor('#00FF00');
|
||||
if (this.model.logicLight) { // 设置哈尔滨逻辑点灯 颜色
|
||||
@ -256,19 +248,12 @@ class Signal extends Group {
|
||||
}
|
||||
// 列车进路
|
||||
trainRoute() {
|
||||
if (this.count == 1) {
|
||||
/** 单灯 列兼调信号*/
|
||||
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.yellowColor);
|
||||
}
|
||||
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.yellowColor);
|
||||
}
|
||||
|
||||
// 调车进路
|
||||
shuntRoute() {
|
||||
if (this.count == 1) {
|
||||
/** 单灯 列兼调信号*/
|
||||
/** 单灯 阻挡兼调车信号*/
|
||||
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.whiteColor);
|
||||
}
|
||||
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.whiteColor);
|
||||
}
|
||||
|
||||
// 引导
|
||||
@ -289,9 +274,7 @@ class Signal extends Group {
|
||||
|
||||
// 封锁
|
||||
block() {
|
||||
if (this.count == 1) {
|
||||
this.lamps[0].setColor(this.style.Signal.lamp.redColor);
|
||||
}
|
||||
this.lamps[0].setColor(this.style.Signal.lamp.redColor);
|
||||
if (this.style.Signal.lamp.guidName == 'haerbin_01') { // 设置底座颜色
|
||||
this.sigPost.setColor('#000080');
|
||||
}
|
||||
@ -304,30 +287,24 @@ class Signal extends Group {
|
||||
|
||||
// 功能封锁
|
||||
functionBlock() {
|
||||
if (this.count == 1) {
|
||||
this.lamps[0].setColor(this.style.Signal.lamp.redColor);
|
||||
}
|
||||
this.lamps[0].setColor(this.style.Signal.lamp.redColor);
|
||||
}
|
||||
|
||||
// 信号保护区段监视状态显示
|
||||
signalCheck() {
|
||||
if (this.count == 1) {
|
||||
this.lamps[0].setColor(this.style.Signal.lamp.redColor);
|
||||
this.sigName.setColor(this.style.Signal.text.checkColor);
|
||||
}
|
||||
this.lamps[0].setColor(this.style.Signal.lamp.redColor);
|
||||
this.sigName.setColor(this.style.Signal.text.checkColor);
|
||||
}
|
||||
|
||||
// 故障
|
||||
fault() {
|
||||
if (this.count == 2) {
|
||||
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.blueColor);
|
||||
this.lamps[1] && this.lamps[1].setColor(this.style.Signal.lamp.blueColor);
|
||||
}
|
||||
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.blueColor);
|
||||
this.lamps[1] && this.lamps[1].setColor(this.style.Signal.lamp.blueColor);
|
||||
}
|
||||
|
||||
// 逻辑点灯
|
||||
logicalLight() {
|
||||
if (this.style.Signal.lamp.guidName != 'haerbin_01') { // 哈尔滨不显示 X
|
||||
if (this.style.Signal.lamp.guidName != 'haerbin_01') { // 哈尔滨不显示 X状态的逻辑点灯
|
||||
this.lamps.forEach(lamp => { lamp.setStop(true); });
|
||||
}
|
||||
}
|
||||
|
@ -161,7 +161,6 @@ export default class Station extends Group {
|
||||
y: model.controlModePoint.y + this.style.Station.StationControl.lamp.offset.y
|
||||
},
|
||||
context: this.style.Station.StationControl.text.emergencyControlText,
|
||||
// model.jjzkContent,
|
||||
pop: false
|
||||
});
|
||||
this.add(this.emergencyControl);
|
||||
@ -178,7 +177,6 @@ export default class Station extends Group {
|
||||
y: model.controlModePoint.y + this.style.Station.StationControl.lamp.offset.y
|
||||
},
|
||||
context: this.style.Station.StationControl.text.centerControlText,
|
||||
// model.zokContent,
|
||||
pop: false
|
||||
});
|
||||
this.add(this.centerControl);
|
||||
@ -195,7 +193,6 @@ export default class Station extends Group {
|
||||
y: model.controlModePoint.y + this.style.Station.StationControl.lamp.offset.y
|
||||
},
|
||||
context: this.style.Station.StationControl.text.substationControlText,
|
||||
// model.zakContent
|
||||
pop: false
|
||||
});
|
||||
this.add(this.substationControl);
|
||||
@ -268,32 +265,35 @@ export default class Station extends Group {
|
||||
this.setState(model);
|
||||
}
|
||||
|
||||
handleCenter() { // 中控
|
||||
this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.greenColor);
|
||||
}
|
||||
|
||||
handleLocal() { // 站控
|
||||
this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.yellowColor);
|
||||
this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
}
|
||||
|
||||
handleEmergency() { // 紧急站控
|
||||
this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.redColor);
|
||||
this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
}
|
||||
|
||||
recover() {
|
||||
this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
}
|
||||
|
||||
// 设置状态
|
||||
setState(model) {
|
||||
if (!this.isShowShape) return;
|
||||
switch (model.controlMode) {
|
||||
case '': // 无状态
|
||||
this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
break;
|
||||
case 'Center': // 中控
|
||||
this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.greenColor);
|
||||
break;
|
||||
case 'Local': // 站控
|
||||
this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.yellowColor);
|
||||
this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
break;
|
||||
case 'Emergency': // 紧急站控
|
||||
this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.redColor);
|
||||
this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
break;
|
||||
}
|
||||
|
||||
this.recover();
|
||||
model.controlMode && this['handle' + model.controlMode]();
|
||||
}
|
||||
|
||||
getShapeTipPoint() {
|
||||
|
@ -1,62 +0,0 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import Text from 'zrender/src/graphic/Text';
|
||||
|
||||
export default class EMouse extends Group {
|
||||
constructor(device) {
|
||||
super();
|
||||
this.device = device;
|
||||
this.create();
|
||||
}
|
||||
create() {
|
||||
this.text = new Text({
|
||||
_subType: 'Text',
|
||||
zlevel: this.device.zlevel,
|
||||
z: this.device.z + 1,
|
||||
position: [0, 0],
|
||||
style: {
|
||||
x: this.device.model.position.x - this.device.style.StationControl.lamp.distance / 2 + this.device.style.StationControl.lamp.offset.x,
|
||||
y: this.device.model.position.y + this.device.style.StationControl.lamp.offset.y + this.device.style.StationControl.lamp.radiusR + this.device.style.StationControl.text.distance - 40,
|
||||
fontWeight: this.device.style.StationControl.mouseOverStyle.fontWeight,
|
||||
fontSize: this.device.style.StationControl.mouseOverStyle.fontSize,
|
||||
fontFamily: this.device.style.StationControl.mouseOverStyle.fontFormat,
|
||||
text: '',
|
||||
textFill: this.device.style.StationControl.mouseOverStyle.fontColor,
|
||||
textAlign: this.device.style.StationControl.mouseOverStyle.textAlign,
|
||||
textVerticalAlign: this.device.style.StationControl.mouseOverStyle.textVerticalAlign
|
||||
}
|
||||
});
|
||||
|
||||
this.add(this.text);
|
||||
this.text.hide();
|
||||
}
|
||||
setTextContext(text) {
|
||||
if (text) {
|
||||
this.text.setStyle('text', text);
|
||||
}
|
||||
}
|
||||
mouseover(e) {
|
||||
if (e.target) {
|
||||
let name = '';
|
||||
switch (e.target.parent._subType) {
|
||||
case 'emergency':
|
||||
name = '紧急站控';
|
||||
break;
|
||||
case 'center':
|
||||
name = '中控';
|
||||
break;
|
||||
case 'substation':
|
||||
name = '站控';
|
||||
break;
|
||||
}
|
||||
// debugger;
|
||||
this.setTextContext(name);
|
||||
this.text.show();
|
||||
}
|
||||
}
|
||||
|
||||
mouseout(e) {
|
||||
if (!this.device.model.down) {
|
||||
this.text.hide();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,198 +0,0 @@
|
||||
/*
|
||||
* 控制模式
|
||||
*/
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import ESingleControl from '../Station/ESingleControl'; // 单个信号灯 (私有)
|
||||
import EArrow from '../Station/EArrow';
|
||||
import { arrow } from '../utils/ShapePoints';
|
||||
import EMouse from './EMouse';
|
||||
|
||||
/** 控制模式*/
|
||||
export default class StationControl extends Group {
|
||||
constructor(model, style) {
|
||||
super();
|
||||
this.selected = false;
|
||||
this._code = model.code;
|
||||
this._type = model._type;
|
||||
this.zlevel = model.zlevel;
|
||||
this.z = 1;
|
||||
this.model = model;
|
||||
this.style = style;
|
||||
this.isShowShape = true;
|
||||
this.create();
|
||||
this.createMouseEvent();
|
||||
this.setState(model);
|
||||
}
|
||||
|
||||
create() {
|
||||
const model = this.model;
|
||||
// 紧急站控
|
||||
if (this.style.Station.StationControl.lamp.emergencyControlShow) {
|
||||
this.emergencyControl = new ESingleControl({
|
||||
_subType: 'emergency',
|
||||
style: this.style,
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
point: {
|
||||
x: model.position.x - this.style.Station.StationControl.lamp.distance * 3 / 2 + this.style.Station.StationControl.lamp.offset.x,
|
||||
y: model.position.y + this.style.Station.StationControl.lamp.offset.y
|
||||
},
|
||||
context: this.style.Station.StationControl.text.emergencyControlText,
|
||||
// model.jjzkContent,
|
||||
pop: false
|
||||
});
|
||||
this.add(this.emergencyControl);
|
||||
}
|
||||
// 中控按钮
|
||||
if (this.style.Station.StationControl.lamp.centerControlShow) {
|
||||
this.centerControl = new ESingleControl({
|
||||
_subType: 'center',
|
||||
style: this.style,
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
point: {
|
||||
x: model.position.x - this.style.Station.StationControl.lamp.distance / 2 + this.style.Station.StationControl.lamp.offset.x,
|
||||
y: model.position.y + this.style.Station.StationControl.lamp.offset.y
|
||||
},
|
||||
context: this.style.Station.StationControl.text.centerControlText,
|
||||
// model.zokContent,
|
||||
pop: false
|
||||
});
|
||||
this.add(this.centerControl);
|
||||
}
|
||||
// 站控按钮
|
||||
if (this.style.Station.StationControl.lamp.substationControlShow) {
|
||||
this.substationControl = new ESingleControl({
|
||||
_subType: 'substation',
|
||||
style: this.style,
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
point: {
|
||||
x: model.position.x + this.style.Station.StationControl.lamp.distance / 2 + this.style.Station.StationControl.lamp.offset.x,
|
||||
y: model.position.y + this.style.Station.StationControl.lamp.offset.y
|
||||
},
|
||||
context: this.style.Station.StationControl.text.substationControlText,
|
||||
// model.zakContent
|
||||
pop: false
|
||||
});
|
||||
this.add(this.substationControl);
|
||||
}
|
||||
// 联锁控
|
||||
if (this.style.Station.StationControl.lamp.interconnectedControlShow) {
|
||||
this.interconnectedControl = new ESingleControl({
|
||||
_subType: 'interconnected',
|
||||
style: this.style,
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
point: {
|
||||
x: model.position.x + this.style.Station.StationControl.lamp.distance * 3 / 2 + this.style.Station.StationControl.lamp.offset.x,
|
||||
y: model.position.y + this.style.Station.StationControl.lamp.offset.y
|
||||
},
|
||||
context: this.style.Station.StationControl.text.interconnectedControlText || '联锁控',
|
||||
pop: false
|
||||
});
|
||||
this.add(this.interconnectedControl);
|
||||
}
|
||||
// 箭头
|
||||
if (this.style.Station.StationControl.arrow.show) {
|
||||
const point = arrow(this.model.position.x, this.model.position.y + this.style.Station.StationControl.lamp.radiusR / 2, this.style.Station.StationControl.lamp.distance / 6, this.style.Station.StationControl.lamp.radiusR * 0.8);
|
||||
this.arrowsControl = new EArrow({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
style: this.style,
|
||||
count: this.count,
|
||||
drict: 1,
|
||||
point: point,
|
||||
x: model.position.x + this.style.Station.StationControl.lamp.offset.x,
|
||||
y: model.position.y + this.style.Station.StationControl.lamp.radiusR / 2 + this.style.Station.StationControl.lamp.offset.y,
|
||||
fill: this.style.Station.StationControl.lamp.grayColor,
|
||||
lineWidth: 1,
|
||||
stroke: this.style.sidelineColor
|
||||
});
|
||||
this.add(this.arrowsControl);
|
||||
}
|
||||
}
|
||||
|
||||
// 设置状态
|
||||
setState(model) {
|
||||
if (!this.isShowShape) return;
|
||||
// switch (model.status) {
|
||||
// case '00': // 无状态
|
||||
// this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
// this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
// this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
// break;
|
||||
// case '01': // 中控
|
||||
// this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
// this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
// this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.greenColor);
|
||||
// break;
|
||||
// case '02': // 站控
|
||||
// this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
// this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.yellowColor);
|
||||
// this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
// break;
|
||||
// case '03': // 紧急站控
|
||||
// this.emergencyControl && this.emergencyControl.setColor(this.style.Station.StationControl.lamp.redColor);
|
||||
// this.substationControl && this.substationControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
// this.centerControl && this.centerControl.setColor(this.style.Station.StationControl.lamp.grayColor);
|
||||
// break;
|
||||
// }
|
||||
}
|
||||
|
||||
getArcBoundingRect(view) {
|
||||
const rect = view.getBoundingRect().clone();
|
||||
const scale = view.scale[0];
|
||||
const offsetX = view.position[0];
|
||||
const offsetY = view.position[1];
|
||||
rect.x = rect.x * scale + offsetX - 2;
|
||||
rect.y = rect.y * scale + offsetY - 2;
|
||||
rect.width = rect.width * scale + 4;
|
||||
rect.height = rect.height * scale + 4;
|
||||
return rect;
|
||||
}
|
||||
|
||||
/** 按钮是否按下*/
|
||||
isPop(e) {
|
||||
for (var i = 0; i < this.childCount(); i++) {
|
||||
var rect = this.childAt(i).getBoundingRect();
|
||||
if (rect.contain(e.offsetX, e.offsetY) && this.childAt(i).pop) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
createMouseEvent() {
|
||||
if (this.style.ZcControl.mouseOverStyle) {
|
||||
this.mouseEvent = new EMouse(this);
|
||||
this.add(this.mouseEvent);
|
||||
this.on('mouseout', (e) => { this.mouseEvent.mouseout(e); });
|
||||
this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); });
|
||||
}
|
||||
}
|
||||
getShapeTipPoint() {
|
||||
if (this.stationControl) {
|
||||
var distance = 2;
|
||||
var rect = this.stationControl.getBoundingRect();
|
||||
return {
|
||||
x: rect.x + rect.width / 2,
|
||||
y: rect.y - distance
|
||||
};
|
||||
}
|
||||
return null;
|
||||
}
|
||||
setShowMode() {}
|
||||
setShowStation(stationCode) {
|
||||
if (!stationCode || this.model.stationCode === stationCode) {
|
||||
this.eachChild(item => {
|
||||
item.show();
|
||||
});
|
||||
this.isShowShape = true;
|
||||
this.setState(this.model);
|
||||
} else {
|
||||
this.eachChild(item => {
|
||||
item.hide();
|
||||
});
|
||||
this.isShowShape = false;
|
||||
}
|
||||
}
|
||||
}
|
@ -79,6 +79,7 @@ class StationStand extends Group {
|
||||
r: style.StationStand.standEmergent.mergentR,
|
||||
n: 4
|
||||
});
|
||||
this.add(this.emergent);
|
||||
|
||||
// 列车停站
|
||||
const stopX = model.position.x;
|
||||
@ -95,6 +96,7 @@ class StationStand extends Group {
|
||||
r: style.StationStand.standEmergent.mergentR,
|
||||
n: 4
|
||||
});
|
||||
this.add(this.trainStop);
|
||||
|
||||
// 列车出发
|
||||
const departX = model.position.x;
|
||||
@ -109,6 +111,7 @@ class StationStand extends Group {
|
||||
x: departX,
|
||||
y: departY
|
||||
});
|
||||
this.add(this.trainDepart);
|
||||
|
||||
/** 站台折返策略*/
|
||||
const reentryH = style.StationStand.standEmergent.mergentR;
|
||||
@ -124,8 +127,7 @@ class StationStand extends Group {
|
||||
lineWidth: 0,
|
||||
fill: style.StationStand.reentry.noHumanColor
|
||||
});
|
||||
|
||||
// const distance = style.StationStand.safetyDoor.height * 2 - style.StationStand.stand.headFontSize / 2 - 2;
|
||||
this.add(this.reentry);
|
||||
|
||||
/** 站台扣车*/
|
||||
const detainD = model.right ? 1 : -1;
|
||||
@ -147,6 +149,7 @@ class StationStand extends Group {
|
||||
textAlign: 'middle',
|
||||
textVerticalAlign: 'top'
|
||||
});
|
||||
this.add(this.detain);
|
||||
|
||||
/** 停站时间*/
|
||||
const timeDrict = model.right ? 1 : -1;
|
||||
@ -160,6 +163,7 @@ class StationStand extends Group {
|
||||
y: timeY,
|
||||
name: model.parkingTime || '30'
|
||||
});
|
||||
this.add(this.time);
|
||||
|
||||
/** 运行等级*/
|
||||
const levelDrict = model.right ? 1 : -1;
|
||||
@ -173,6 +177,7 @@ class StationStand extends Group {
|
||||
y: levelY,
|
||||
name: model.runLevelTime || '5'
|
||||
});
|
||||
this.add(this.level);
|
||||
|
||||
/** 列车停跳 */
|
||||
if (style.StationStand.common.haveJumpShow) {
|
||||
@ -203,14 +208,6 @@ class StationStand extends Group {
|
||||
});
|
||||
this.add(this.jump);
|
||||
}
|
||||
|
||||
this.add(this.emergent);
|
||||
this.add(this.detain);
|
||||
this.add(this.reentry);
|
||||
this.add(this.time);
|
||||
this.add(this.level);
|
||||
this.add(this.trainStop);
|
||||
this.add(this.trainDepart);
|
||||
}
|
||||
|
||||
createMouseEvent() {
|
||||
@ -357,9 +354,7 @@ class StationStand extends Group {
|
||||
recover() {
|
||||
this.time && this.time.hide();
|
||||
this.level && this.level.hide();
|
||||
// if (!this.style.StationStand.common.special) {
|
||||
this.detain && this.detain.hide();
|
||||
// }
|
||||
this.emergent && this.emergent.hide();
|
||||
this.trainStop && this.trainStop.hide(); // 列车停站
|
||||
this.trainDepart && this.trainDepart.hide();
|
||||
@ -509,12 +504,10 @@ class StationStand extends Group {
|
||||
}
|
||||
|
||||
/** 设置跳停*/
|
||||
// model.allSkip = 1;
|
||||
model.assignSkip && this.designatedJumpStop(); // 指定列车跳停
|
||||
model.allSkip && this.jumpStop(); // 站台全部跳停
|
||||
|
||||
/** 设置扣车*/
|
||||
// model.centerHoldTrain = 1;
|
||||
if (model.stationHoldTrain && model.centerHoldTrain) {
|
||||
this.standAndCenterDetainTrain(); // 中心+车站扣车
|
||||
} else if (model.stationHoldTrain) {
|
||||
|
@ -269,8 +269,6 @@ export default class Switch extends Group {
|
||||
this.setSwitchCoreColor(this.style.backgroundColor);
|
||||
this.name.getNameText().stopAnimation(false);
|
||||
this.swCore.stopAnimation(false);
|
||||
// this.relocShelter.hide();
|
||||
// this.rhomboid.hide();
|
||||
this.sheltertriangle.hide();
|
||||
this.rhomboid.stopAnimation(false);
|
||||
this.releaseBackground.hide();
|
||||
@ -333,10 +331,6 @@ export default class Switch extends Group {
|
||||
});
|
||||
}
|
||||
|
||||
/** 空闲*/
|
||||
spare() {
|
||||
}
|
||||
|
||||
/** 单锁*/
|
||||
setMonolock() {
|
||||
if (this.style.Switch.monolock.rectShow) { // 判断单锁矩形是否显示
|
||||
@ -443,7 +437,7 @@ export default class Switch extends Group {
|
||||
model.blockade && this.block();
|
||||
/** 区段切除*/
|
||||
model.cutOff && this.setSwitchCutOff();
|
||||
if (this.style.Switch.sectionAction.flag) {
|
||||
if (this.style.Switch.sectionAction.flag) { // 哈尔滨线路处理道岔相关区段颜色
|
||||
const switchModel = Vue.prototype.$jlmap.mapDevice[model.code];
|
||||
if (switchModel.normalPosition != 0) { // 定位情况
|
||||
const sectionC = Vue.prototype.$jlmap.mapDevice[switchModel.sectionCCode];
|
||||
|
@ -231,7 +231,7 @@ export const translate = {
|
||||
{ key: 'code', tHeader: '编号', formatter: (val) => { return val || ''; } },
|
||||
{ key: 'namePosition', tHeader: '名称坐标', formatter: (val) => { return val ? JSON.parse(val) : ''; } },
|
||||
// { key: 'nameShow', tHeader: '名称是否显示', formatter: (val) => { return val || false; } },
|
||||
{ key: 'axleShow', tHeader: '是否显示计轴器', formatter: (val) => { return val || false; } },
|
||||
// { key: 'axleShow', tHeader: '是否显示计轴器', formatter: (val) => { return val || false; } },
|
||||
{ key: 'type', tHeader: '类型', formatter: (val) => { return val || ''; } },
|
||||
{ key: 'linkCode', tHeader: 'link编号', formatter: (val) => { return val || ''; } },
|
||||
// { key: 'logicSectionNameShow', tHeader: '是否显示逻辑区段名称', formatter: (val) => { return val || false; } },
|
||||
|
@ -2,7 +2,6 @@ import store from '@/store';
|
||||
import { Notification } from 'element-ui';
|
||||
|
||||
function handle(state, data) {
|
||||
console.log(data, 'socket订阅');
|
||||
const msg = data.body;
|
||||
const path = window.location.href;
|
||||
switch (data.type) {
|
||||
@ -21,14 +20,18 @@ function handle(state, data) {
|
||||
handleRecordList(state, msg);
|
||||
break;
|
||||
case 'Simulation_DeviceStatus': // 仿真-设备状态消息
|
||||
console.log(data, '设备状态消息');
|
||||
state.equipmentStatus = msg;
|
||||
break;
|
||||
case 'Simulation_RunFact': // 仿真-列车实际到发车站消息
|
||||
let runFactMsg = msg;
|
||||
if (runFactMsg.constructor !== Array ) {
|
||||
runFactMsg = [msg];
|
||||
// let runFactMsg = msg;
|
||||
// if (runFactMsg.constructor !== Array ) {
|
||||
// runFactMsg = [msg];
|
||||
// }
|
||||
if (!Array.isArray(msg)) {
|
||||
console.log([msg], '列车实际到发车站消息');
|
||||
state.trainStationList = [msg];
|
||||
}
|
||||
state.trainStationList = runFactMsg;
|
||||
break;
|
||||
case 'Simulation_Error': // 仿真-异常消息
|
||||
state.simulationError = msg;
|
||||
|
@ -225,7 +225,6 @@ export default {
|
||||
rightStopPointOffset: 0, // 右向停车点偏移量
|
||||
destinationCode: '', // 目的地码
|
||||
destinationCodePoint: { x: 0, y: 0 }, // 目的地码坐标
|
||||
axleShow: false,
|
||||
namePosition: { x: 0, y: 0 },
|
||||
kmRangeRight: 0,
|
||||
kmRangeLeft: 0,
|
||||
@ -664,7 +663,6 @@ export default {
|
||||
code: getUID('Section'),
|
||||
name: String.fromCharCode(index + 'A'.charCodeAt()),
|
||||
parentCode: model.code,
|
||||
axleShow: false,
|
||||
type: '02',
|
||||
namePosition: { x: 0, y: 0 },
|
||||
isStandTrack: false,
|
||||
@ -809,7 +807,6 @@ export default {
|
||||
code: uid,
|
||||
name: uname,
|
||||
type: '01',
|
||||
axleShow: false,
|
||||
isStandTrack: false,
|
||||
standTrackName: '',
|
||||
standTrackNamePosition: { x: 0, y: 0 },
|
||||
@ -979,7 +976,6 @@ export default {
|
||||
name: `${selected.name}_${index}`,
|
||||
type: '01',
|
||||
parentCode: '',
|
||||
axleShow: selected.axleShow,
|
||||
isStandTrack: false,
|
||||
kmRangeRight: '',
|
||||
kmRangeLeft: '',
|
||||
@ -1084,7 +1080,6 @@ export default {
|
||||
models.push(deepAssign(this.$store.getters['map/getDeviceByCode'](rsection.code), { _dispose: true }));
|
||||
|
||||
if (lsection.points[lsection.points.length - 1].x == rsection.points[0].x && lsection.points[lsection.points.length - 1].y == rsection.points[0].y) {
|
||||
model.axleShow = lsection.axleShow;
|
||||
model.logicSectionNum = lsection.logicSectionNum;
|
||||
model.logicSectionShow = lsection.logicSectionShow;
|
||||
model.trainPosType = lsection.trainPosType;
|
||||
@ -1104,7 +1099,6 @@ export default {
|
||||
this.$emit('updateMapModel', models);
|
||||
}
|
||||
if (lsection.points[0].x == rsection.points[rsection.points.length - 1].x && lsection.points[0].y == rsection.points[rsection.points.length - 1].y) {
|
||||
model.axleShow = rsection.axleShow;
|
||||
model.logicSectionNum = rsection.logicSectionNum;
|
||||
model.logicSectionShow = rsection.logicSectionShow;
|
||||
model.trainPosType = rsection.trainPosType;
|
||||
|
@ -432,7 +432,6 @@ export default {
|
||||
code: uid,
|
||||
name: sectiona.name || sectionb.name || sectionc.name,
|
||||
type: '03',
|
||||
axleShow: false,
|
||||
namePosition: point,
|
||||
isStandTrack: false,
|
||||
kmRangeRight: '',
|
||||
|
@ -191,7 +191,6 @@ export default {
|
||||
code: uid,
|
||||
name: name,
|
||||
type: '01',
|
||||
axleShow: false,
|
||||
standTrack: false,
|
||||
standTrackName: '',
|
||||
standTrackNamePosition: { x: 0, y: 0 },
|
||||
|
@ -74,7 +74,6 @@ export default {
|
||||
rightStopPointOffset: 0, // 右向停车点偏移量
|
||||
destinationCode: '', // 目的地码
|
||||
destinationCodePoint: { x: 0, y: 0 }, // 目的地码坐标
|
||||
axleShow: false,
|
||||
namePosition: { x: 0, y: 0 },
|
||||
kmRangeRight: 0,
|
||||
kmRangeLeft: 0,
|
||||
|
@ -138,7 +138,6 @@ export default {
|
||||
code: getUID('T', [...this.sectionList, ...this.addList]),
|
||||
name: String.fromCharCode(index + 'A'.charCodeAt()),
|
||||
parentCode: model.code,
|
||||
axleShow: false,
|
||||
type: '02',
|
||||
namePosition: { x: 0, y: 0 },
|
||||
standTrack: false,
|
||||
|
@ -160,7 +160,6 @@ export default {
|
||||
name: `${selected.name}_${index}`,
|
||||
type: '01',
|
||||
parentCode: '',
|
||||
axleShow: selected.axleShow,
|
||||
standTrack: false,
|
||||
kmRangeRight: '',
|
||||
kmRangeLeft: '',
|
||||
@ -296,7 +295,6 @@ export default {
|
||||
});
|
||||
},
|
||||
handleRealLocationRelationships(model, realRigth, realLeft) {
|
||||
model.axleShow = realLeft.axleShow;
|
||||
model.logicSectionNum = realLeft.logicSectionNum;
|
||||
model.logicSectionShow = realLeft.logicSectionShow;
|
||||
model.sepTypeLeft = realLeft.sepTypeLeft;
|
||||
|
@ -330,7 +330,6 @@ export default {
|
||||
code: elem.uid,
|
||||
name: sectiona.name,
|
||||
type: '04',
|
||||
axleShow: false,
|
||||
namePosition: point,
|
||||
standTrack: false,
|
||||
kmRangeRight: '',
|
||||
|
@ -76,14 +76,11 @@ export default {
|
||||
if (sectiona.length <= 0) {
|
||||
return false;
|
||||
}
|
||||
// const sectionCode = this.fromData.relevanceSectionList[0];
|
||||
// const sectiona = deepAssign({}, this.$store.getters['map/getDeviceByCode'](sectionCode));
|
||||
models.push({
|
||||
_type: 'Section',
|
||||
code: uid,
|
||||
name: uid,
|
||||
type: '04',
|
||||
axleShow: false,
|
||||
namePosition: {
|
||||
x: sectiona[sectiona.length - 1].x,
|
||||
y: sectiona[sectiona.length - 1].y
|
||||
|
Loading…
Reference in New Issue
Block a user