西安二号线信号机调整逻辑点灯

This commit is contained in:
fan 2020-05-14 16:04:23 +08:00
parent 6eb6cd5340
commit b3743326bc
2 changed files with 56 additions and 27 deletions

View File

@ -165,6 +165,7 @@ class SkinCode extends defaultStyle {
},
lamp: {
bgShow: false, // 是否被选中
logicColor: true, // cbtc通信是否影响灯颜色
guidName: 'singleRY', // 默认引导类型
borderVariable: true, // 信号灯边框可变
stopWidth: 2, // 禁止线宽度

View File

@ -314,39 +314,67 @@ class Signal extends Group {
}
// 关闭
close() {
if (this.count == 2) { // 双灯
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.redColor);
this.lamps[1] && this.lamps[1].setColor(this.style.backgroundColor);
} else if (this.count == 1) { // 单灯
if (this.model.useType == '05' && this.lamps[0]) { // 调车信号机
this.lamps[0].setColor(this.style.Signal.lamp.blueColor);
} else {
this.lamps[0].setColor(this.style.Signal.lamp.redColor);
close(logicLight) {
if (this.style.Signal.lamp.logicColor && logicLight) {
// 逻辑点灯影响灯颜色仅西安二且暂无双灯
if (this.count == 1) {
this.lamps[0].setColor(this.style.Signal.lamp.grayColor);
this.insideTriangle.show();
this.insideTriangle.setStyle({fill: this.style.Signal.lamp.redColor});
}
} else {
if (this.count == 2) { // 双灯
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.redColor);
this.lamps[1] && this.lamps[1].setColor(this.style.backgroundColor);
} else if (this.count == 1) { // 单灯
if (this.model.useType == '05' && this.lamps[0]) { // 调车信号机
this.lamps[0].setColor(this.style.Signal.lamp.blueColor);
} else {
this.lamps[0].setColor(this.style.Signal.lamp.redColor);
}
}
}
}
/* 正向开放*/
openPositive() {
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.greenColor);
this.lamps[1] && this.lamps[1].setColor(this.style.backgroundColor); // 设置黑色
this.virtualSignal && this.virtualSignal.setColor(this.style.Signal.lamp.greenColor);
if (this.style.Signal.lamp.guidName === 'doubleAndBase') { // 设置底座颜色
this.sigPost.setColor('#00FF00');
if (this.model.logicLight) {
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.blueColor);
openPositive(logicLight) {
if (this.style.Signal.lamp.logicColor && logicLight) {
// 逻辑点灯影响灯颜色仅西安二且暂无双灯
if (this.count == 1) {
this.lamps[0].setColor(this.style.Signal.lamp.grayColor);
this.insideTriangle.show();
this.insideTriangle.setStyle({fill: this.style.Signal.lamp.greenColor});
}
} else {
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.greenColor);
this.lamps[1] && this.lamps[1].setColor(this.style.backgroundColor); // 设置黑色
this.virtualSignal && this.virtualSignal.setColor(this.style.Signal.lamp.greenColor);
if (this.style.Signal.lamp.guidName === 'doubleAndBase') { // 设置底座颜色
this.sigPost.setColor('#00FF00');
if (this.model.logicLight) {
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.blueColor);
}
}
}
}
/* 侧向开放 */
openLateral() {
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.yellowColor);
this.lamps[1] && this.lamps[1].setColor(this.style.backgroundColor);
if (this.style.Signal.lamp.guidName === 'doubleAndBase') { // 设置底座颜色
this.sigPost.setColor('#00FF00');
if (this.model.logicLight) { // 设置哈尔滨逻辑点灯 颜色
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.blueColor);
openLateral(logicLight) {
if (this.style.Signal.lamp.logicColor && logicLight) {
if (this.count == 1) {
this.lamps[0].setColor(this.style.Signal.lamp.grayColor);
this.insideTriangle.show();
this.insideTriangle.setStyle({fill: this.style.Signal.lamp.yellowColor});
}
} else {
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.yellowColor);
this.lamps[1] && this.lamps[1].setColor(this.style.backgroundColor);
if (this.style.Signal.lamp.guidName === 'doubleAndBase') { // 设置底座颜色
this.sigPost.setColor('#00FF00');
if (this.model.logicLight) { // 设置哈尔滨逻辑点灯 颜色
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.blueColor);
}
}
}
}
@ -529,9 +557,9 @@ class Signal extends Group {
model.blockade && this.block();
/** 设置灯的颜色 */
model.redOpen && model.yellowOpen && !model.greenOpen && this.guid(); // 引导信号显示
model.redOpen && !model.yellowOpen && !model.greenOpen && this.close(); // 信号关闭
model.greenOpen && !model.redOpen && !model.yellowOpen && this.openPositive(); // 信号正向开放
model.yellowOpen && !model.redOpen && !model.greenOpen && this.openLateral(); // 信号侧向开放
model.redOpen && !model.yellowOpen && !model.greenOpen && this.close(model.logicLight); // 信号关闭
model.greenOpen && !model.redOpen && !model.yellowOpen && this.openPositive(model.logicLight); // 信号正向开放
model.yellowOpen && !model.redOpen && !model.greenOpen && this.openLateral(model.logicLight); // 信号侧向开放
/** 进路交人工控或自动控 */
!model.atsControl && this.setArtificialRouteClose();
// 联锁自动进路通过