调整哈尔滨信号机状态

This commit is contained in:
zyy 2020-03-19 18:39:20 +08:00
parent 67f0712eaa
commit 2f654975d5
5 changed files with 44 additions and 20 deletions

View File

@ -141,7 +141,7 @@ class SkinCode extends defaultStyle {
standardShow: true, // 灯柱显示 standardShow: true, // 灯柱显示
standardLength: 4, // 高柱长度 standardLength: 4, // 高柱长度
standardHeight: 5, // 灯柱高度 standardHeight: 5, // 灯柱高度
standardColor: '#3149C3', // 灯柱颜色 standardColor: '#FF0000', // 灯柱颜色
standardWidth: 4 // 灯柱宽度 standardWidth: 4 // 灯柱宽度
}, },
text: { text: {
@ -151,22 +151,22 @@ class SkinCode extends defaultStyle {
fontSize: 11, // 信号机名称字体大小 fontSize: 11, // 信号机名称字体大小
fontWeight: 'bold', // 信号机名称字体粗细 fontWeight: 'bold', // 信号机名称字体粗细
defaultColor: '#FFFFFF', // 信号灯字体默认色 defaultColor: '#FFFFFF', // 信号灯字体默认色
blockColor: '#EF0C08', // 信号灯字体锁定颜色 blockColor: '#ffffff', // 信号灯字体锁定颜色
checkColor: '#00FF00', // 信号字体 checkColor: '#00FF00', // 信号字体
nameBorderShow: true // 信号机名字边框显示 nameBorderShow: false // 信号机名字边框显示
}, },
lamp: { lamp: {
bgShow: true, // 是否被选中 bgShow: true, // 是否被选中
logicDisplayNone: true, // 逻辑点灯斜线不显示 logicDisplayNone: true, // 逻辑点灯斜线不显示
guidName: 'defult', // 默认引导类型 guidName: 'haerbin_01', // 默认引导类型
stopWidth: 2, // 禁止线宽度 stopWidth: 2, // 禁止线宽度
borderWidth: 1, // 信号灯边框线宽度 borderWidth: 0, // 信号灯边框线宽度
borderColor: '#3149C3', // 信号灯边框线颜色 borderColor: '#FF0000', // 信号灯边框线颜色 (虚拟信号机)
radiusR: 4, // 信号灯半径 radiusR: 4, // 信号灯半径
blockColor: '#EF0C08', // 信号灯锁闭 blockColor: '#EF0C08', // 信号灯锁闭
grayColor: '#7F7F7F', // 信号灯灰色 grayColor: '#7F7F7F', // 信号灯灰色
redColor: '#FF0000', // 信号灯红色 redColor: '#FF0000', // 信号灯红色
greenColor: '#00FF00', // 信号灯绿色 greenColor: '#000080', // 信号灯绿色
yellowColor: '#FFFF00', // 信号灯黄色 yellowColor: '#FFFF00', // 信号灯黄色
whiteColor: '#FFFFFF', // 信号灯白色 whiteColor: '#FFFFFF', // 信号灯白色
blueColor: '#0070C0' // 信号灯蓝色 blueColor: '#0070C0' // 信号灯蓝色

View File

@ -702,7 +702,6 @@ export default class Section extends Group {
stroke: this.style.Section.line.protectiveLockColor, stroke: this.style.Section.line.protectiveLockColor,
lineWidth: this.style.Section.line.width + this.style.Section.line.beyondWidth lineWidth: this.style.Section.line.width + this.style.Section.line.beyondWidth
}); });
this.setModelTypeLevel();
} }
} }
@ -752,7 +751,6 @@ export default class Section extends Group {
{ time: 1000, styles: { stroke: this.style.backgroundColor } }, { time: 1000, styles: { stroke: this.style.backgroundColor } },
{ time: 2000, styles: { lineWidth: lineWidth } } { time: 2000, styles: { lineWidth: lineWidth } }
]); ]);
this.setModelTypeLevel();
} }
} }

View File

@ -11,7 +11,7 @@ class ESigPost extends Group {
create() { create() {
const model = this.model; const model = this.model;
const style = this.model.style; const style = this.model.style;
// 竖杆
this.ver = new Polyline({ this.ver = new Polyline({
_subType: 'SignalLamp', _subType: 'SignalLamp',
_val: '3', _val: '3',
@ -28,7 +28,7 @@ class ESigPost extends Group {
stroke: style.Signal.post.standardColor stroke: style.Signal.post.standardColor
} }
}); });
// 横杆
this.hor = new Polyline({ this.hor = new Polyline({
zlevel: model.zlevel, zlevel: model.zlevel,
z: model.z, z: model.z,
@ -53,6 +53,13 @@ class ESigPost extends Group {
} }
} }
setColor(color) {
if (color) {
this.ver && this.ver.setStyle({ stroke: color });
this.hor && this.hor.setStyle({ stroke: color });
}
}
getLampPosition(type) { getLampPosition(type) {
const model = this.model; const model = this.model;
const style = this.model.style; const style = this.model.style;

View File

@ -42,7 +42,7 @@ class Signal extends Group {
const drict = this.model.right ? 1 : -1; // 朝向 左:右 const drict = this.model.right ? 1 : -1; // 朝向 左:右
const posit = this.model.positionType == '01' ? -1 : 1; // 位置 上:下 const posit = this.model.positionType == '01' ? -1 : 1; // 位置 上:下
// 信号机高柱矮柱 // 信号机高柱矮柱 (信号机底座)
this.sigPost = new ESigPost({ this.sigPost = new ESigPost({
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z, z: this.z,
@ -56,7 +56,7 @@ class Signal extends Group {
// 信号灯 // 信号灯
const endPoint = this.sigPost.getLampPosition(model.lampPostType); const endPoint = this.sigPost.getLampPosition(model.lampPostType);
this.lamps = []; this.lamps = [];
if (style.Signal.lamp.guidName == 'ningbo_01' && this.count == 1) { if ((style.Signal.lamp.guidName == 'ningbo_01' || style.Signal.lamp.guidName == 'haerbin_01') && this.count == 1) {
this.count = 2; this.count = 2;
} }
for (let i = 0; i < this.count; i++) { for (let i = 0; i < this.count; i++) {
@ -305,26 +305,30 @@ class Signal extends Group {
this.lamps[0].setColor(this.style.Signal.lamp.greenColor); this.lamps[0].setColor(this.style.Signal.lamp.greenColor);
} }
} }
this.virtualSignal && this.virtualSignal.setColor(this.style.Signal.lamp.greenColor);
if (this.style.Signal.lamp.guidName == 'haerbin_01') { // 设置底座颜色
this.sigPost.setColor('#00FF00');
}
} }
/* count 1单灯 2双灯 lightType 逻辑点灯 true物理点灯 false */ /* count 1单灯 2双灯 lightType 逻辑点灯 true物理点灯 false */
openLateral() { // 侧向开放 openLateral() { // 侧向开放
if (this.count == 2 && !this.model.lightType) { if (this.count == 2 && !this.model.lightType) {
if (this.lamps[0]) { if (this.lamps[0]) {
this.lamps[0].setStop(false); this.lamps[0].setStop(false);
this.lamps[0].setColor(this.style.backgroundColor); this.lamps[0].setColor(this.style.Signal.lamp.yellowColor);
} }
if (this.lamps[1]) { if (this.lamps[1]) {
this.lamps[1].setStop(false); this.lamps[1].setStop(false);
this.lamps[1].setColor(this.style.Signal.lamp.yellowColor); this.lamps[1].setColor(this.style.backgroundColor);
} }
} else if (this.count == 2 && this.model.lightType) { } else if (this.count == 2 && this.model.lightType) {
if (this.lamps[0]) { if (this.lamps[0]) {
this.lamps[0].setStop(true); this.lamps[0].setStop(true);
this.lamps[0].setColor(this.style.backgroundColor); this.lamps[0].setColor(this.style.Signal.lamp.yellowColor);
} }
if (this.lamps[1]) { if (this.lamps[1]) {
this.lamps[1].setStop(true); this.lamps[1].setStop(true);
this.lamps[1].setColor(this.style.Signal.lamp.yellowColor); this.lamps[1].setColor(this.style.backgroundColor);
} }
} else if (this.count == 1 && !this.model.lightType) { } else if (this.count == 1 && !this.model.lightType) {
if (this.lamps[0]) { if (this.lamps[0]) {
@ -342,6 +346,9 @@ class Signal extends Group {
this.lamps[0].setColor(this.style.Signal.lamp.greenColor); this.lamps[0].setColor(this.style.Signal.lamp.greenColor);
} }
} }
if (this.style.Signal.lamp.guidName == 'haerbin_01') { // 设置底座颜色
this.sigPost.setColor('#00FF00');
}
} }
// 列车进路 // 列车进路
trainRoute() { trainRoute() {
@ -362,9 +369,12 @@ class Signal extends Group {
// 引导 // 引导
guid() { guid() {
if (this.style.Signal.lamp.guidName == 'ningbo_01') { if (this.style.Signal.lamp.guidName == 'ningbo_01' || this.style.Signal.lamp.guidName == 'haerbin_01') {
this.lamps[1].show(); this.lamps[1].show();
} }
if (this.style.Signal.lamp.guidName == 'haerbin_01') { // 设置底座颜色
this.sigPost.setColor('#00FF00');
}
if (this.count == 2 && !this.model.lightType && this.style.Signal.lamp.guidName != 'chengdu_03') { // 双灯 物理点灯 允许引导信号 if (this.count == 2 && !this.model.lightType && this.style.Signal.lamp.guidName != 'chengdu_03') { // 双灯 物理点灯 允许引导信号
if (this.lamps[0]) { if (this.lamps[0]) {
this.lamps[0].setStop(false); this.lamps[0].setStop(false);
@ -384,7 +394,9 @@ class Signal extends Group {
block() { block() {
if (this.count == 1) { if (this.count == 1) {
this.lamps[0].setColor(this.style.Signal.lamp.redColor); this.lamps[0].setColor(this.style.Signal.lamp.redColor);
// this.siglamp.setNameBorder(1) }
if (this.style.Signal.lamp.guidName == 'haerbin_01') { // 设置底座颜色
this.sigPost.setColor('#000080');
} }
this.sigName.setColor(this.style.Signal.text.blockColor); this.sigName.setColor(this.style.Signal.text.blockColor);
if (this.style.Signal.text.nameBorderShow) { if (this.style.Signal.text.nameBorderShow) {
@ -482,6 +494,7 @@ class Signal extends Group {
this.sigAuto.animationRecover(); this.sigAuto.animationRecover();
this.sigRoute.hide(); this.sigRoute.hide();
this.sigName.setColor(this.style.Signal.text.defaultColor); this.sigName.setColor(this.style.Signal.text.defaultColor);
this.sigPost.setColor(this.style.Signal.post.standardColor); // 设置底座默认颜色
if (this.style.Signal.lamp.guidName == 'chengdu_03') { if (this.style.Signal.lamp.guidName == 'chengdu_03') {
this.lamps[0].setStyle({ lineWidth: this.style.Signal.lamp.borderWidth }); this.lamps[0].setStyle({ lineWidth: this.style.Signal.lamp.borderWidth });
} }
@ -506,10 +519,16 @@ class Signal extends Group {
model.blockade && this.block(); model.blockade && this.block();
/** 设置灯的颜色 */ /** 设置灯的颜色 */
// model.redOpen = 0;
// model.yellowOpen = 0;
// model.greenOpen = 1;
model.redOpen && model.yellowOpen && !model.greenOpen && this.guid(); // 引导信号显示 model.redOpen && model.yellowOpen && !model.greenOpen && this.guid(); // 引导信号显示
model.redOpen && !model.yellowOpen && !model.greenOpen && this.close(); // 信号关闭 model.redOpen && !model.yellowOpen && !model.greenOpen && this.close(); // 信号关闭
model.greenOpen && !model.redOpen && !model.yellowOpen && this.openPositive(); // 信号正向开放 model.greenOpen && !model.redOpen && !model.yellowOpen && this.openPositive(); // 信号正向开放
model.yellowOpen && !model.redOpen && !model.greenOpen && this.openLateral(); // 信号侧向开放 model.yellowOpen && !model.redOpen && !model.greenOpen && this.openLateral(); // 信号侧向开放
if (this.style.Signal.lamp.guidName == 'haerbin_01') { // 设置底座颜色
model.yellowOpen && !model.redOpen && !model.greenOpen && this.openPositive(); // 信号侧向开放
}
/** 进路交人工控或自动控 */ /** 进路交人工控或自动控 */
!model.atsControl && this.setArtificialRouteClose(); !model.atsControl && this.setArtificialRouteClose();

View File

@ -215,7 +215,7 @@ export default {
<style scoped rel="stylesheet/scss" lang="scss"> <style scoped rel="stylesheet/scss" lang="scss">
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";
$width: 30px; $width: 30px;
$height: 60px; $height: 90px;
$menuPadding: 10px; $menuPadding: 10px;
$menuItemHeight: 30px; $menuItemHeight: 30px;
$menuItemWidth: 190px; $menuItemWidth: 190px;