From 6eb3fecc4b6e946eb0d60d1b2c9e16ad9991a3af Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Mon, 9 Sep 2019 10:41:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=A1=E5=8F=B7=E6=9C=BA=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmap/constant/deviceState.js | 11 ++++--- src/jmap/shape/Signal/index.js | 53 +++++++++++++++++--------------- 2 files changed, 35 insertions(+), 29 deletions(-) diff --git a/src/jmap/constant/deviceState.js b/src/jmap/constant/deviceState.js index 8b6625d30..7390d415d 100644 --- a/src/jmap/constant/deviceState.js +++ b/src/jmap/constant/deviceState.js @@ -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: { diff --git a/src/jmap/shape/Signal/index.js b/src/jmap/shape/Signal/index.js index e0efe7c5b..4ae2c0402 100644 --- a/src/jmap/shape/Signal/index.js +++ b/src/jmap/shape/Signal/index.js @@ -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; // 信号保护区段检测 } /** 进路性质类型*/