From 2ddc94f7aa67053d9a3e2edf7cccaefe922e009c Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Fri, 18 Dec 2020 13:10:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=97=E4=BA=AC=E4=BA=8C=E5=8F=B7=E7=BA=BF?= =?UTF-8?q?=E7=9A=AE=E8=82=A4=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/bejing_01.js | 3 +- src/jmapNew/config/skinCode/chengdu_01.js | 3 +- src/jmapNew/config/skinCode/chengdu_03.js | 3 +- src/jmapNew/config/skinCode/foshan_01.js | 3 +- src/jmapNew/config/skinCode/fuzhou_01.js | 3 +- src/jmapNew/config/skinCode/haerbin_01.js | 3 +- src/jmapNew/config/skinCode/nanjing_02.js | 6 +- src/jmapNew/config/skinCode/ningbo_01.js | 3 +- src/jmapNew/config/skinCode/ningbo_03.js | 3 +- src/jmapNew/config/skinCode/race_01.js | 3 +- src/jmapNew/config/skinCode/xian_01.js | 3 +- src/jmapNew/config/skinCode/xian_02.js | 3 +- src/jmapNew/shape/Signal/ESigPost.js | 69 +++++++++++++++-------- src/jmapNew/shape/Signal/index.js | 4 +- 14 files changed, 73 insertions(+), 39 deletions(-) diff --git a/src/jmapNew/config/skinCode/bejing_01.js b/src/jmapNew/config/skinCode/bejing_01.js index 5c0308133..d8e766104 100644 --- a/src/jmapNew/config/skinCode/bejing_01.js +++ b/src/jmapNew/config/skinCode/bejing_01.js @@ -133,7 +133,8 @@ class SkinCode extends defaultStyle { standardLength: 6, // 高柱长度 standardHeight: 6, // 灯柱高度 standardColor: '#5578B6', // 灯灯柱颜色 - standardWidth: 1.5 // 灯柱宽度 + standardVerticalWidth: 1.5, // 灯柱竖杆宽度 + standardRailWidth: 1.5 // 灯柱横杆宽度 }, text: { show: true, // 信号机名称显示 diff --git a/src/jmapNew/config/skinCode/chengdu_01.js b/src/jmapNew/config/skinCode/chengdu_01.js index 53f27194f..5d936448d 100644 --- a/src/jmapNew/config/skinCode/chengdu_01.js +++ b/src/jmapNew/config/skinCode/chengdu_01.js @@ -141,7 +141,8 @@ class SkinCode extends defaultStyle { standardLength: 6, // 高柱长度 standardHeight: 6, // 灯柱高度 standardColor: '#C0C0C0', // 灯柱颜色 - standardWidth: 2 // 灯柱宽度 + standardVerticalWidth: 2, // 灯柱竖杆宽度 + standardRailWidth: 2 // 灯柱横杆宽度 }, text: { show: true, // 信号机名称显示 diff --git a/src/jmapNew/config/skinCode/chengdu_03.js b/src/jmapNew/config/skinCode/chengdu_03.js index 773aaceab..fe98b57a7 100644 --- a/src/jmapNew/config/skinCode/chengdu_03.js +++ b/src/jmapNew/config/skinCode/chengdu_03.js @@ -147,7 +147,8 @@ class SkinCode extends defaultStyle { standardLength: 6, // 高柱长度 standardHeight: 6, // 灯柱高度 standardColor: '#FFFFFF', // 灯柱颜色 - standardWidth: 2 // 灯柱宽度 + standardVerticalWidth: 2, // 灯柱竖杆宽度 + standardRailWidth: 2 // 灯柱横杆宽度 }, text: { show: true, // 信号机名称显示 diff --git a/src/jmapNew/config/skinCode/foshan_01.js b/src/jmapNew/config/skinCode/foshan_01.js index 72e90c9ab..43663387c 100644 --- a/src/jmapNew/config/skinCode/foshan_01.js +++ b/src/jmapNew/config/skinCode/foshan_01.js @@ -125,7 +125,8 @@ class SkinCode extends defaultStyle { standardLength: 6, // 高柱长度 standardHeight: 6, // 灯柱高度 standardColor: '#3149C3', // 灯珠颜色 - standardWidth: 2 // 灯珠宽度 + standardVerticalWidth: 2, // 灯柱竖杆宽度 + standardRailWidth: 2 // 灯柱横杆宽度 }, text: { show: true, // 信号机名称显示 diff --git a/src/jmapNew/config/skinCode/fuzhou_01.js b/src/jmapNew/config/skinCode/fuzhou_01.js index 40cc992db..66d35f5f9 100644 --- a/src/jmapNew/config/skinCode/fuzhou_01.js +++ b/src/jmapNew/config/skinCode/fuzhou_01.js @@ -125,7 +125,8 @@ class SkinCode extends defaultStyle { standardLength: 6, // 高柱长度 standardHeight: 6, // 灯柱高度 standardColor: '#3149C3', // 灯珠颜色 - standardWidth: 2 // 灯珠宽度 + standardVerticalWidth: 2, // 灯柱竖杆宽度 + standardRailWidth: 2 // 灯柱横杆宽度 }, text: { show: true, // 信号机名称显示 diff --git a/src/jmapNew/config/skinCode/haerbin_01.js b/src/jmapNew/config/skinCode/haerbin_01.js index ea1d37e3e..3066e10e8 100644 --- a/src/jmapNew/config/skinCode/haerbin_01.js +++ b/src/jmapNew/config/skinCode/haerbin_01.js @@ -148,7 +148,8 @@ class SkinCode extends defaultStyle { standardLength: 4, // 高柱长度 standardHeight: 5, // 灯柱高度 standardColor: '#FF0000', // 灯柱颜色 - standardWidth: 4 // 灯柱宽度 + standardVerticalWidth: 4, // 灯柱竖杆宽度 + standardRailWidth: 4 // 灯柱横杆宽度 }, text: { show: true, // 信号机名称显示 diff --git a/src/jmapNew/config/skinCode/nanjing_02.js b/src/jmapNew/config/skinCode/nanjing_02.js index ea1d37e3e..a0f27cbc8 100644 --- a/src/jmapNew/config/skinCode/nanjing_02.js +++ b/src/jmapNew/config/skinCode/nanjing_02.js @@ -145,10 +145,12 @@ class SkinCode extends defaultStyle { distance: 10, // 设备距离区段的距离 post: { standardShow: true, // 灯柱显示 - standardLength: 4, // 高柱长度 + standardVerticalShape: '8', // 灯柱 竖杆 8边型 + standardLength: 12, // 高柱长度 standardHeight: 5, // 灯柱高度 standardColor: '#FF0000', // 灯柱颜色 - standardWidth: 4 // 灯柱宽度 + standardVerticalWidth: 1, // 灯柱竖杆宽度 + standardRailWidth: 6 // 灯柱横杆宽度 }, text: { show: true, // 信号机名称显示 diff --git a/src/jmapNew/config/skinCode/ningbo_01.js b/src/jmapNew/config/skinCode/ningbo_01.js index a8b58e64c..d44eedb48 100644 --- a/src/jmapNew/config/skinCode/ningbo_01.js +++ b/src/jmapNew/config/skinCode/ningbo_01.js @@ -128,7 +128,8 @@ class SkinCode extends defaultStyle { standardLength: 6, // 高柱长度 standardHeight: 6, // 灯柱高度 standardColor: '#C0C0C0', // 灯柱颜色 - standardWidth: 2 // 灯柱宽度 + standardVerticalWidth: 2, // 灯柱竖杆宽度 + standardRailWidth: 2 // 灯柱横杆宽度 }, text: { show: true, // 信号机名称显示 diff --git a/src/jmapNew/config/skinCode/ningbo_03.js b/src/jmapNew/config/skinCode/ningbo_03.js index 75bb13fa9..903960e87 100644 --- a/src/jmapNew/config/skinCode/ningbo_03.js +++ b/src/jmapNew/config/skinCode/ningbo_03.js @@ -164,7 +164,8 @@ class SkinCode extends defaultStyle { standardHeight: 6, // 灯柱高度 standardColor: '#000000', // 灯柱颜色 physicColor:'#c0c0c0', // 物理点灯灯柱颜色 - standardWidth: 2 // 灯柱宽度 + standardVerticalWidth: 2, // 灯柱竖杆宽度 + standardRailWidth: 2 // 灯柱横杆宽度 }, text: { show: true, // 信号机名称显示 diff --git a/src/jmapNew/config/skinCode/race_01.js b/src/jmapNew/config/skinCode/race_01.js index 5c4ab8f49..7834e4f12 100644 --- a/src/jmapNew/config/skinCode/race_01.js +++ b/src/jmapNew/config/skinCode/race_01.js @@ -150,7 +150,8 @@ class SkinCode extends defaultStyle { standardLength: 6, // 高柱长度 standardHeight: 6, // 灯柱高度 standardColor: '#969696', // 灯灯柱颜色 - standardWidth: 3 // 灯柱宽度 + standardVerticalWidth: 3, // 灯柱竖杆宽度 + standardRailWidth: 3 // 灯柱横杆宽度 }, text: { show: true, // 信号机名称显示 diff --git a/src/jmapNew/config/skinCode/xian_01.js b/src/jmapNew/config/skinCode/xian_01.js index e3fda6713..eea50c1a4 100644 --- a/src/jmapNew/config/skinCode/xian_01.js +++ b/src/jmapNew/config/skinCode/xian_01.js @@ -133,7 +133,8 @@ class SkinCode extends defaultStyle { standardLength: 6, // 高柱长度 standardHeight: 6, // 灯柱高度 standardColor: '#3149C3', // 灯珠颜色 - standardWidth: 2 // 灯珠宽度 + standardVerticalWidth: 2, // 灯柱竖杆宽度 + standardRailWidth: 2 // 灯柱横杆宽度 }, text: { show: true, // 信号机名称显示 diff --git a/src/jmapNew/config/skinCode/xian_02.js b/src/jmapNew/config/skinCode/xian_02.js index c5d687bb4..189ac2a4a 100644 --- a/src/jmapNew/config/skinCode/xian_02.js +++ b/src/jmapNew/config/skinCode/xian_02.js @@ -142,7 +142,8 @@ class SkinCode extends defaultStyle { standardLength: 7, // 高柱长度 standardHeight: 6, // 灯柱高度 standardColor: '#fff', // 灯柱颜色 - standardWidth: 2, // 灯柱宽度 + standardVerticalWidth: 2, // 灯柱竖杆宽度 + standardRailWidth: 2, // 灯柱横杆宽度 autoRouteColor: '#008000', // 自动进路开启灯柱颜色 shapeChange: true, // 灯柱形状改变 terminalOptional: '#CC3399' // 终端可选信号机灯柱颜色 diff --git a/src/jmapNew/shape/Signal/ESigPost.js b/src/jmapNew/shape/Signal/ESigPost.js index 5f23398c5..3f1fc12f2 100644 --- a/src/jmapNew/shape/Signal/ESigPost.js +++ b/src/jmapNew/shape/Signal/ESigPost.js @@ -12,23 +12,49 @@ class ESigPost extends Group { create() { const model = this.model; const style = this.model.style; - // 竖杆 - this.ver = new Polyline({ - _subType: 'SignalLamp', - _val: '3', - zlevel: model.zlevel, - z: model.z, - shape: { - points: [ - [model.x, model.y + style.Signal.post.standardHeight * 1.2], - [model.x, model.y - style.Signal.post.standardHeight * 1.2] - ] - }, - style: { - lineWidth: style.Signal.post.standardWidth, - stroke: style.Signal.post.standardColor - } - }); + // 基座 + let verPoints = [[model.x, model.y + style.Signal.post.standardHeight * 1.2], [model.x, model.y - style.Signal.post.standardHeight * 1.2]]; + if (style.Signal.post.standardVerticalShape && style.Signal.post.standardVerticalShape === '8') { + verPoints = [ + [model.x - model.drict * 2, model.y + style.Signal.post.standardHeight * 1.2], + [model.x - model.drict * 2, model.y - style.Signal.post.standardHeight * 1.2], + [model.x, model.y - style.Signal.post.standardHeight * 1.2], + [model.x, model.y - style.Signal.post.standardRailWidth / 2], + [model.x + model.drict * 2, model.y - style.Signal.post.standardRailWidth / 2], + [model.x + model.drict * 2, model.y + style.Signal.post.standardRailWidth / 2], + [model.x, model.y + style.Signal.post.standardRailWidth / 2], + [model.x, model.y + style.Signal.post.standardHeight * 1.2] + ]; + this.ver = new Polygon({ + _subType: 'SignalLamp', + _val: '3', + zlevel: model.zlevel, + z: model.z, + shape: { + points: verPoints + }, + style: { + lineWidth: style.Signal.post.standardVerticalWidth, + stroke: style.Signal.post.standardColor, + fill: style.Signal.post.standardColor + } + }); + } else { + this.ver = new Polyline({ + _subType: 'SignalLamp', + _val: '3', + zlevel: model.zlevel, + z: model.z, + shape: { + points: verPoints + }, + style: { + lineWidth: style.Signal.post.standardVerticalWidth, + stroke: style.Signal.post.standardColor, + fill: style.Signal.post.standardColor + } + }); + } // 横杆 this.hor = new Polyline({ zlevel: model.zlevel, @@ -41,18 +67,13 @@ class ESigPost extends Group { ] }, style: { - lineWidth: style.Signal.post.standardWidth, + lineWidth: style.Signal.post.standardRailWidth, stroke: style.Signal.post.standardColor } }); this.add(this.ver); this.add(this.hor); - - model.type === '01' ? this.hor.hide() : this.hor.show(); - if (style.Signal.post.standardShow) { - this.hor.show(); - } } setColor(color) { @@ -100,7 +121,7 @@ class ESigPost extends Group { if (style.Signal.post.standardShow) { type = '01'; } - const length = style.Signal.post.standardShow ? 4 : 0; + const length = style.Signal.post.standardShow ? style.Signal.post.standardLength : 0; if (type === '01') { return { x: model.x + model.drict * style.Signal.lamp.radiusR * 3 / 2 + model.drict * length, diff --git a/src/jmapNew/shape/Signal/index.js b/src/jmapNew/shape/Signal/index.js index 6c852fe24..7bdf700d3 100644 --- a/src/jmapNew/shape/Signal/index.js +++ b/src/jmapNew/shape/Signal/index.js @@ -180,7 +180,7 @@ class Signal extends Group { this.sigBack.hide(); } // 信号机名称 - const sigNameX = model.position.x + model.positionPoint.x - drict * (style.Signal.post.standardWidth) + model.namePosition.x; + const sigNameX = model.position.x + model.positionPoint.x - drict * (style.Signal.post.standardVerticalWidth) + model.namePosition.x; const sigNameY = model.position.y + model.positionPoint.y + posit * (style.Signal.distance + style.Section.line.width + style.Signal.lamp.radiusR * 2 + model.namePosition.y + style.Signal.text.distance); const textAlign = style.Signal.text.isAlignCenter ? 'middle' : this.model.right ? 'left' : 'right'; const textVerticalAlign = posit == 1 ? 'top' : 'bottom'; @@ -725,7 +725,7 @@ class Signal extends Group { const rect = this.sigPost.getBoundingRect().clone(); return { - x: rect.x + drict * this.style.Signal.post.standardWidth, + x: rect.x + drict * this.style.Signal.post.standardVerticalWidth, y: rect.y - offsetY }; }