信号机调整

This commit is contained in:
fan 2019-09-09 10:41:14 +08:00
parent 31454a72c5
commit 6eb3fecc4b
2 changed files with 35 additions and 29 deletions

View File

@ -85,10 +85,13 @@ deviceState[deviceType.Signal] = {
status: {
Default: '01', /** 关闭(缺省值)*/
State01: '01', /** 关闭 */
State02: '02', /** 开放 */
State03: '03', /** 引导 */
State04: '04', /** 封锁 */
State05: '05' /** 故障 */
State02: '02', /** 开放正向 */
State03: '03', /** 开放侧向 */
State04: '04', /** 引导 */
State05: '05', /** 封锁 */
State06: '06', /** 故障 */
State07: '07', /** 功能封锁 */
State08: '08' /** 信号保护区段监视 */
},
/** 信号机状态类型 */
lightType: {

View File

@ -230,9 +230,9 @@ class Signal extends Group {
}
}
// 开放
open() {
if (this.count == 2 && this.model.lightType == '01' && this.model.switchLocateType == '01') { // 双灯 物理点灯 道岔定位
/* count 1单灯 2双灯 lightType 01物理点灯 02逻辑点灯*/
openPositive() {
if (this.count == 2 && this.model.lightType == '01') {
if (this.lamps[0]) {
this.lamps[0].setStop(false);
this.lamps[0].setColor(this.style.Signal.lamp.greenColor);
@ -241,7 +241,7 @@ class Signal extends Group {
this.lamps[1].setStop(false);
this.lamps[1].setColor(this.style.backgroundColor);
}
} else if (this.count == 2 && this.model.lightType == '02' && this.model.switchLocateType == '01') { // 双灯 逻辑点灯 道岔定位
} else if (this.count == 2 && this.model.lightType == '02') {
if (this.lamps[0]) {
this.lamps[0].setStop(true);
this.lamps[0].setColor(this.style.Signal.lamp.greenColor);
@ -250,7 +250,20 @@ class Signal extends Group {
this.lamps[1].setStop(true);
this.lamps[1].setColor(this.style.backgroundColor);
}
} else if (this.count == 2 && this.model.lightType == '01' && this.model.switchLocateType == '02') { // 双灯 物理点灯 道岔反位
} else if (this.count == 1 && this.model.lightType == '01') {
if (this.lamps[0]) {
this.lamps[0].setStop(false);
this.lamps[0].setColor(this.style.Signal.lamp.greenColor);
}
} else if (this.count == 1 && this.model.lightType == '02') {
if (this.lamps[0]) {
this.lamps[0].setStop(true);
this.lamps[0].setColor(this.style.Signal.lamp.greenColor);
}
}
}
openLateral() {
if (this.count == 2 && this.model.lightType == '01') {
if (this.lamps[0]) {
this.lamps[0].setStop(false);
this.lamps[0].setColor(this.style.backgroundColor);
@ -259,7 +272,7 @@ class Signal extends Group {
this.lamps[1].setStop(false);
this.lamps[1].setColor(this.style.Signal.lamp.yellowColor);
}
} else if (this.count == 2 && this.model.lightType == '02' && this.model.switchLocateType == '02') { // 双灯 逻辑点灯 道岔反位
} else if (this.count == 2 && this.model.lightType == '02') {
if (this.lamps[0]) {
this.lamps[0].setStop(true);
this.lamps[0].setColor(this.style.backgroundColor);
@ -268,7 +281,7 @@ class Signal extends Group {
this.lamps[1].setStop(true);
this.lamps[1].setColor(this.style.Signal.lamp.yellowColor);
}
} else if (this.count == 1 && this.model.lightType == '01' && this.model.switchLocateType == '02') { // 单灯 物理点灯 允许调车
} else if (this.count == 1 && this.model.lightType == '01') {
if (this.lamps[0]) {
this.lamps[0].setStop(false);
// 出站信号机/阻隔信号机
@ -278,24 +291,13 @@ class Signal extends Group {
this.lamps[0].setColor(this.style.Signal.lamp.whiteColor);
}
}
} else if (this.count == 1 && this.model.lightType == '01' && this.model.switchLocateType == '01') {
if (this.lamps[0]) {
this.lamps[0].setStop(false);
this.lamps[0].setColor(this.style.Signal.lamp.greenColor);
}
} else if (this.count == 1 && this.model.lightType == '02' && this.model.switchLocateType == '02') {
if (this.lamps[0]) {
this.lamps[0].setStop(true);
this.lamps[0].setColor(this.style.Signal.lamp.greenColor);
}
} else if (this.count == 1 && this.model.lightType == '02' && this.model.switchLocateType == '01' ) {
} else if (this.count == 1 && this.model.lightType == '02') {
if (this.lamps[0]) {
this.lamps[0].setStop(true);
this.lamps[0].setColor(this.style.Signal.lamp.greenColor);
}
}
}
// 列车进路
trainRoute() {
if (this.count == 1) {
@ -437,12 +439,13 @@ class Signal extends Group {
/** 设置状态 (点灯类型)*/
switch (model.status) {
case '01': this.close(); break; // 关闭
case '02': this.open(); break; // 开放
case '03': this.guid(); break; // 引导
case '04': this.block(); break; // 封锁
case '05': this.fault(); break; // 故障
case '06': this.block(); break; // 功能封锁
case '07': this.signalCheck(); break; // 信号保护区段检测
case '02': this.openPositive(); break; // 开放正向
case '03': this.openLateral(); break; // 开放侧向
case '04': this.guid(); break; // 引导
case '05': this.block(); break; // 封锁
case '06': this.fault(); break; // 故障
case '07': this.block(); break; // 功能封锁
case '08': this.signalCheck(); break; // 信号保护区段检测
}
/** 进路性质类型*/