From cd5bcfe8881cedfd21b845f5a849b4cbb33d7401 Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Fri, 15 Jan 2021 15:24:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=A1=E5=8F=B7=E6=9C=BA&=E9=81=93=E5=B2=94?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/config/skinCode/nanjing_02.js | 22 ++++++++---- src/jmapNew/shape/Signal/ESigPost.js | 7 +++- src/jmapNew/shape/Signal/index.js | 41 +++++++++++++++++++---- src/jmapNew/shape/Switch/index.js | 24 +++++++++++-- 4 files changed, 77 insertions(+), 17 deletions(-) diff --git a/src/jmapNew/config/skinCode/nanjing_02.js b/src/jmapNew/config/skinCode/nanjing_02.js index 8afe9e979..35325e256 100644 --- a/src/jmapNew/config/skinCode/nanjing_02.js +++ b/src/jmapNew/config/skinCode/nanjing_02.js @@ -116,18 +116,18 @@ class SkinCode extends defaultStyle { speedLimitName: { z: 10, leftName: true, // 左侧限速值是否展示 - rightName: false, // 右侧限速值是否展示 + rightName: false, // 右侧限速值是否展示 nameBackgroundIsRect: true, // 限速值背景是否为矩形 nameBackgroundBorderWidth: 0, // 限速值背景是否边框宽度 nameBackgroundBorderColor: '#C00808', // 限速值背景边框颜色 limitValueDistance: 18, - kilometerFontSize: 0, // 公里标大小 - nameAlone: true, // 只显示一个限速名称 + kilometerFontSize: 0, // 公里标大小 + nameAlone: true, // 只显示一个限速名称 nameNumberFontSize: 11, // 限速值大小 nameNumberColor: '#C00808', // 限速值颜色 nameBackground: '#000', // 限速名称背景颜色 drogueWidth: 15, // 浮标宽度 - drogueHeight: 12, // 浮标高度 + drogueHeight: 12 // 浮标高度 }, separator: { z: 3, // 分割符层级 @@ -168,6 +168,13 @@ class SkinCode extends defaultStyle { distance: 10, // 设备距离区段的距离 post: { standardShow: true, // 灯柱显示 + reblockHorColor: '#000080', // 信号机重复封锁灯柱颜色 + guideHorColor: '#FF0', // 引导信号 灯柱横柱颜色 + closeHorColor: '#F00', // 关闭信号 灯柱横柱颜色 + openHorColor: '#0F0', // 信号出清 灯柱横柱颜色 + mainSignalVerColor: '#00FF00', // 主信号控制级 灯柱竖柱颜色 level 3 + closeSignalVerColor: '#FF1F10', // 关闭信号 灯柱竖柱颜色 level 1 + guideSignalVerColor: '#FFFF00', // 引导信号控制级 灯柱竖柱颜色 level 2 standardVerticalShape: '8', // 灯柱 竖杆 8边型 standardLength: 12, // 高柱长度 standardHeight: 5, // 灯柱高度 @@ -190,7 +197,7 @@ class SkinCode extends defaultStyle { }, lamp: { bgShow: true, // 是否被选中 - guidName: 'double', // 默认引导类型 + guidName: 'post', // 默认引导类型 stopWidth: 2, // 禁止线宽度 borderWidth: 0, // 信号灯边框线宽度 borderColor: '#FF0000', // 信号灯边框线颜色 (虚拟信号机) @@ -529,7 +536,10 @@ class SkinCode extends defaultStyle { monolock: false, // 名称单锁显示包围框 monolockLocationColor: '#F00', // 道岔单锁'定位'颜色 monolockInversionColor: '#F00', // 道岔单锁'反位'颜色 - faultFlashing: false // 故障闪烁 + faultFlashing: false, // 故障闪烁 + routeLockBorderColor: '#F00', // 进路锁闭道岔名称边框颜色 + fpLockBorderColor: '#fff', // 进路侧防道岔名称边框颜色 + overlapLockBorderColor: '#F00' // 进路延续保护道岔名称边框颜色 }, sectionAction: { flag: true, // 道岔 关联区段显示 diff --git a/src/jmapNew/shape/Signal/ESigPost.js b/src/jmapNew/shape/Signal/ESigPost.js index 6e5ef608c..2ea786f26 100644 --- a/src/jmapNew/shape/Signal/ESigPost.js +++ b/src/jmapNew/shape/Signal/ESigPost.js @@ -75,7 +75,12 @@ class ESigPost extends Group { this.add(this.ver); this.add(this.hor); } - + getVer() { + return this.ver; + } + getHor() { + return this.hor; + } setColor(color) { if (color) { this.ver && this.ver.setStyle({ stroke: color }); diff --git a/src/jmapNew/shape/Signal/index.js b/src/jmapNew/shape/Signal/index.js index d6a23a64c..642c0c361 100644 --- a/src/jmapNew/shape/Signal/index.js +++ b/src/jmapNew/shape/Signal/index.js @@ -375,6 +375,10 @@ class Signal extends Group { this.lamps[1] && this.lamps[1].setColor(this.style.backgroundColor); this.lamps[2] && this.lamps[2].setColor(this.style.backgroundColor); } + if (this.style.Signal.post.closeHorColor) { + const hor = this.sigPost.getHor(); + hor.setStyle({ stroke: this.style.Signal.post.closeHorColor }); + } } } @@ -407,6 +411,10 @@ class Signal extends Group { this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.blueColor); } } + if (this.style.Signal.post.openHorColor) { + const hor = this.sigPost.getHor(); + hor.setStyle({ stroke: this.style.Signal.post.openHorColor }); + } } } @@ -446,16 +454,18 @@ class Signal extends Group { this.cbtcStatus = 'guid'; if (this.style.Signal.lamp.guidName === 'double') { this.lamps[1].show(); - } - if (this.style.Signal.lamp.guidName === 'doubleAndBase') { // 设置底座颜色 + } else if (this.style.Signal.lamp.guidName === 'doubleAndBase') { // 设置底座颜色 this.lamps[1].show(); this.sigPost.setColor('#00FF00'); - } - if (this.style.Signal.lamp.guidName !== 'singleRY') { // 双灯 允许引导信号 + } else if (this.style.Signal.lamp.guidName !== 'singleRY') { // 双灯 允许引导信号 this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.redColor); this.lamps[1] && this.lamps[1].setColor(this.style.Signal.lamp.yellowColor); } else if (this.style.Signal.lamp.guidName === 'singleRY') { this.lamps[0].setStyle({ fill: this.style.Signal.lamp.yellowColor, stroke: this.style.Signal.lamp.redColor, lineWidth: 2.5 }); + } else if (this.style.Signal.lamps.guidName === 'post') { + this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.redColor); + const hor = this.sigPost.getHor(); + hor.setStyle({ stroke: this.style.Signal.post.guideHorColor }); } } @@ -477,7 +487,12 @@ class Signal extends Group { this.sigBack.setStyle('fill', this.style.Signal.sigBack.fillColor); } } - + reblock() { + if (this.style.Signal.post.reblockHorColor) { + const hor = this.sigPost.getHor(); + hor.setStyle({ stroke: this.style.Signal.post.reblockHorColor }); + } + } // 功能封锁 functionBlock() { this.lamps[0].setColor(this.style.Signal.lamp.redColor); @@ -687,12 +702,14 @@ class Signal extends Group { } /** 设置灯的颜色 */ - model.redOpen && model.yellowOpen && !model.greenOpen && this.guid(); // 引导信号显示 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.redOpen && model.yellowOpen && !model.greenOpen && this.guid(); // 引导信号显示 + /** 信号机封锁 */ // 缺一个功能封锁 model.blockade && this.block(); + model.reblockade && this.reblock(); model.remainTime && this.showRemainTime(model.remainTime); if (!path.includes('/map/draw')) { // 联锁自动进路通过 @@ -743,10 +760,20 @@ class Signal extends Group { }); } } + const ver = this.sigPost.getVer(); + if ( model.level === 3 && this.style.Signal.post.mainSignalVerColor) { + ver.setStyle({ stroke: this.style.Signal.post.mainSignalVerColor, fill: this.style.Signal.post.mainSignalVerColor }); + } else if (model.level === 1 && this.style.Signal.post.closeSignalVerColor) { + ver.setStyle({ stroke: this.style.Signal.post.closeSignalVerColor, fill: this.style.Signal.post.closeSignalVerColor }); + } else if (model.level === 2 && this.style.Signal.post.guideSignalVerColor) { + ver.setStyle({ stroke: this.style.Signal.post.guideSignalVerColor, fill: this.style.Signal.post.guideSignalVerColor }); + } // 信号机故障 model.fault && this.fault(); // 设置灰显 - model.noStatus && this.setAshShow(); + if (model.noStatus || model.level === 0) { + this.setAshShow(); + } } getBoundingRect() { diff --git a/src/jmapNew/shape/Switch/index.js b/src/jmapNew/shape/Switch/index.js index 94a5cb9ec..ce19e5d2d 100644 --- a/src/jmapNew/shape/Switch/index.js +++ b/src/jmapNew/shape/Switch/index.js @@ -262,9 +262,10 @@ export default class Switch extends Group { this.name.getNameText().setStyle(style); } - /** 设置道岔文字边框颜色 (道岔封锁) */ - setHasTextBorder(width) { + /** 设置道岔文字边框颜色 */ + setHasTextBorder(width, color) { this.name.getTextRect().setStyle({ lineWidth: width }); + color && this.name.getTextRect().setStyle({ stroke: color }); } /** 恢复状态*/ @@ -585,6 +586,9 @@ export default class Switch extends Group { if (!path.includes('/map/draw')) { this.setSectionState(this.model); // 处理元素颜色 } + model.routeLock && this.handleRouteLock(); // 道岔进路锁闭 + model.overlapLock && this.handleOverlapLock(); // 道岔进路延续保护 + model.fpLock && this.handleFpLock(); // 道岔侧防 // this.interlockingReserved(); // 联锁预留道岔 if (this.style.Switch.sectionAction.flag) { // 哈尔滨线路处理道岔相关区段颜色 @@ -600,7 +604,21 @@ export default class Switch extends Group { getBoundingRect() { return this.name.getBoundingRect(); } - + handleRouteLock() { + if (this.style.Switch.text.routeLockBorderColor) { + this.setHasTextBorder(1, this.style.Switch.text.routeLockBorderColor); + } + } + handleOverlapLock() { + if (this.style.Switch.text.overlapLockBorderColor) { + this.setHasTextBorder(1, this.style.Switch.text.overlapLockBorderColor); + } + } + handleFpLock() { + if (this.style.Switch.text.fpLockBorderColor) { + this.setHasTextBorder(1, this.style.Switch.text.fpLockBorderColor); + } + } getShapeTipPoint(opts) { let rect; let text;