信号机灯状态增加RW

This commit is contained in:
Yuan 2022-05-12 11:29:55 +08:00
parent a69e27f434
commit 53a2a1478d

View File

@ -701,7 +701,11 @@ class Signal extends Group {
doubleYellow() {
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.yellowColor);
this.lamps[1] && this.lamps[1].setColor(this.style.Signal.lamp.yellowColor);
}
}
redWhite() {
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.whiteColor);
this.lamps[1] && this.lamps[1].setColor(this.style.Signal.lamp.redColor);
}
lampWhite() {
if (this.lamps.length === 1) {
this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.whiteColor);
@ -1019,42 +1023,46 @@ class Signal extends Group {
/** 设置灯的颜色 */
switch (model.aspect) {
// 红
case 'R': {
this.close(model.logicLight); // 信号关闭
break;
}
// 绿
case 'G': {
this.openPositive(model.logicLight); // 信号正向开放
break;
}
// 黄
case 'Y': {
this.openLateral(model.logicLight); // 信号侧向开放
break;
}
// 红黄
case 'RY': {
this.guid(); // 引导信号显示
break;
}
case 'W': {
this.lampWhite();
break;
}
case 'B': {
this.lampBlue();
break;
}
case 'YY': {
this.doubleYellow();
break;
}
default: {
this.close(model.logicLight); // 信号关闭
break;
}
// 红
case 'R': {
this.close(model.logicLight); // 信号关闭
break;
}
// 绿
case 'G': {
this.openPositive(model.logicLight); // 信号正向开放
break;
}
// 黄
case 'Y': {
this.openLateral(model.logicLight); // 信号侧向开放
break;
}
// 红黄
case 'RY': {
this.guid(); // 引导信号显示
break;
}
case 'W': {
this.lampWhite();
break;
}
case 'B': {
this.lampBlue();
break;
}
case 'YY': {
this.doubleYellow();
break;
}
case 'RW': {
this.redWhite();
break;
}
default: {
this.close(model.logicLight); // 信号关闭
break;
}
}
if (model.remainTime) {