修改代码

This commit is contained in:
ival 2019-07-15 14:45:18 +08:00
parent ecc5329924
commit c89f2dec49
6 changed files with 42 additions and 40 deletions

View File

@ -76,7 +76,7 @@ deviceState[deviceType.Switch] = {
deviceState[deviceType.Signal] = { deviceState[deviceType.Signal] = {
/** 进路性质类型 */ /** 进路性质类型 */
natureType: { natureType: {
Default: '01', /** 列车进路(缺省值)*/ Default: '00', /** 无状态(缺省值)*/
State01: '01', /** 列车进路 */ State01: '01', /** 列车进路 */
State02: '02', /** 调车进路 */ State02: '02', /** 调车进路 */
State03: '03' /** 折返进路 */ State03: '03' /** 折返进路 */

View File

@ -131,10 +131,7 @@ fuzhouSkin[deviceType.Signal] = {
signalLampStandardWidth: 1, signalLampStandardWidth: 1,
/** 设备距离区段的距离*/ /** 设备距离区段的距离*/
signalDistance: 12, signalDistance: 13,
/** 信号灯锁闭*/
signalBlockColor: '#EF0C08',
/** 信号灯按钮边线*/ /** 信号灯按钮边线*/
signalButtonDashColor: '#C0C0C0', // '#C0C0C0' signalButtonDashColor: '#C0C0C0', // '#C0C0C0'
@ -152,22 +149,25 @@ fuzhouSkin[deviceType.Signal] = {
signalTextGreen: '#00FF00', signalTextGreen: '#00FF00',
/** 信号灯灯柱颜色*/ /** 信号灯灯柱颜色*/
signalLampStandardColor: '#3149C3', signalLampStandardColor: '#606060',
/** 信号灯灰色*/ /** 信号灯灰色*/
signalLampGrayColor: '#51545D', signalLampGrayColor: '#7F7F7F',
/** 信号灯绿色*/ /** 信号灯绿色*/
signalLampGreenColor: '#4DD43F', signalLampGreenColor: '#00FF00',
/** 信号灯黄色*/ /** 信号灯黄色*/
signalLampYellowColor: '#E4EF50', signalLampYellowColor: '#FFFF00',
/** 信号灯白色*/ /** 信号灯白色*/
signalLampWhiteColor: '#FFFFFF', signalLampWhiteColor: '#FFFFFF',
/** 信号灯蓝色*/ /** 信号灯蓝色*/
signalLampBlueColor: '#3E44BE' signalLampBlueColor: '#0000FF',
/** 信号灯锁闭*/
signalBlockColor: '#EF0C08'
}; };
fuzhouSkin[deviceType.Switch] = { fuzhouSkin[deviceType.Switch] = {
@ -181,7 +181,7 @@ fuzhouSkin[deviceType.Switch] = {
transparentColor: 'rgba(0,0,0,0)', transparentColor: 'rgba(0,0,0,0)',
/** 默认字体 大小*/ /** 默认字体 大小*/
textFontSize: 8.2, textFontSize: 9,
/** 默认字体 族类*/ /** 默认字体 族类*/
textFontFormat: 'consolas', textFontFormat: 'consolas',
@ -195,6 +195,9 @@ fuzhouSkin[deviceType.Switch] = {
/** 默认名称和设备的距离*/ /** 默认名称和设备的距离*/
nameDistance: 2, nameDistance: 2,
/** 区段宽超出宽度*/
sectionBeyondWidth: 0,
/** 区段 宽度*/ /** 区段 宽度*/
sectionWidth: 4.4, sectionWidth: 4.4,

View File

@ -941,7 +941,6 @@ export default class Signal extends Group {
setState(state) { setState(state) {
this.recover(); this.recover();
/** 设置状态 (点灯类型)*/ /** 设置状态 (点灯类型)*/
switch (state.status) { switch (state.status) {
case '01': this.close(); break; // 关闭 case '01': this.close(); break; // 关闭

View File

@ -33,9 +33,9 @@ export default class Switch extends Group {
this.triangle = new JTriangle(model.intersection, model.skew); this.triangle = new JTriangle(model.intersection, model.skew);
this.createSwitch(); this.createSwitch();
this.createNameText(); this.createNameText();
// this.craeteSwitchBorder(); this.craeteSwitchBorder();
this.setState(state); this.setState(state);
// this.mouseStateRecover(); this.mouseStateRecover();
} }
/** 道岔实体,不显示,响应鼠标事件*/ /** 道岔实体,不显示,响应鼠标事件*/
@ -44,7 +44,7 @@ export default class Switch extends Group {
const style = this.style; const style = this.style;
var halfWidth = style.sectionWidth / 2; // 一般宽度 var halfWidth = style.sectionWidth / 2; // 一般宽度
var switchWidth = style.sectionWidth + style.sectionBeyondWidth + style.sectionBeyondWidth + 0.8; // 道岔宽度, 增大遮挡宽度0.8 var switchWidth = style.sectionWidth + style.sectionBeyondWidth*2 + 0.8; // 道岔宽度, 增大遮挡宽度0.8
var swPadding = style.switchLen; // 定位和反位时区段距离岔芯的距离 var swPadding = style.switchLen; // 定位和反位时区段距离岔芯的距离
var directx = this.triangle.drictx; var directx = this.triangle.drictx;
var directy = this.triangle.dricty; var directy = this.triangle.dricty;
@ -358,7 +358,7 @@ export default class Switch extends Group {
this.releaseBackground.hide(); this.releaseBackground.hide();
this.setHasTextBorder(0); this.setHasTextBorder(0);
switch (this.model.locateType) { switch (this.state.locateType) {
case '01': // 定位 case '01': // 定位
this.setTextColor(this.style.switchLocateTextColor); this.setTextColor(this.style.switchLocateTextColor);
break; break;
@ -445,7 +445,7 @@ export default class Switch extends Group {
case '01': // 定位 case '01': // 定位
// this.release.show(); // this.release.show();
this.releaseBackground.hide(); this.releaseBackground.hide();
this.setSectionstate(this.release, 'stroke', this.model.sectionAstatus); this.setSectionState(this.release, 'stroke', this.model.sectionAstatus);
// this.release.animateStyle(true) // this.release.animateStyle(true)
// .when(1000, { stroke: this.style.backgroundColor }) // .when(1000, { stroke: this.style.backgroundColor })
// .start(); // .start();
@ -458,59 +458,59 @@ export default class Switch extends Group {
} }
} }
setSectionstate(section, style, state) { setSectionState(section, style, state) {
if (section) { if (section) {
switch (state) { switch (state) {
case '00': break; case '00': break;
case '01': /** 空闲*/ case '01': /** 空闲*/
section.setStyle(style, this.style.sectionSpareColor); section.setStyle(style, this.style.sectionSpareColor);
break; break;
case '02': /** 通信车占用*/ case '02': /** 通信车占用*/
section.setStyle(style, this.style.sectionCommunicationOccupiedColor); section.setStyle(style, this.style.sectionCommunicationOccupiedColor);
break; break;
case '03': /** 非通信车占用*/ case '03': /** 非通信车占用*/
section.setStyle(style, this.style.sectionUnCommunicationOccupiedColor); section.setStyle(style, this.style.sectionUnCommunicationOccupiedColor);
break; break;
case '04': /** 进路锁闭*/ case '04': /** 进路锁闭*/
section.setStyle(style, this.style.sectionRouteLockColor); section.setStyle(style, this.style.sectionRouteLockColor);
break; break;
case '05': /** 故障锁闭*/ case '05': /** 故障锁闭*/
section.setStyle(style, this.style.sectionFaultLockColor); section.setStyle(style, this.style.sectionFaultLockColor);
break; break;
case '06': /** 封锁*/ case '06': /** 封锁*/
section.setStyle(style, this.style.sectionBlockColor); section.setStyle(style, this.style.sectionBlockColor);
break; break;
case '07': /** ATC切除*/ case '07': /** ATC切除*/
section.setStyle(style, this.style.sectionAtcExcisionColor); section.setStyle(style, this.style.sectionAtcExcisionColor);
break; break;
case '08': /** ATS切除*/ case '08': /** ATS切除*/
section.setStyle(style, this.style.sectionAtsExcisionColor); section.setStyle(style, this.style.sectionAtsExcisionColor);
section.animateStyle(true) section.animateStyle(true)
.when(1000, { fill: this.style.backgroundColor }) .when(1000, { fill: this.style.backgroundColor })
.when(2000, { fill: this.style.sectionAtsExcisionColor }) .when(2000, { fill: this.style.sectionAtsExcisionColor })
.start(); .start();
break; break;
case '09': /** 进路延续保护 */ case '09': /** 进路延续保护 */
section.setStyle(style, this.style.sectionProtectiveLockColor); section.setStyle(style, this.style.sectionProtectiveLockColor);
break; break;
} }
} }
} }
setLocateType(model) { setLocateType(state) {
this.setSectionstate(this.reserveSection, 'fill', model.sectionCstatus); this.setSectionState(this.reserveSection, 'fill', this.model.sectionCstatus);
switch (model.locateType) { switch (state.locateType) {
case '01': case '01':
this.setLocationAction(); /** 定位*/ this.setLocationAction(); /** 定位*/
break; break;
case '02': case '02':
this.setInversionAction(); /** 反位*/ this.setInversionAction(); /** 反位*/
break; break;
case '03': case '03':
this.setLossAction(true); /** 失去*/ this.setLossAction(true); /** 失去*/
break; break;
case '04': case '04':
this.setForkAction(); /** 挤岔*/ this.setForkAction(); /** 挤岔*/
break; break;
} }
} }
@ -519,16 +519,16 @@ export default class Switch extends Group {
this.setLocateType(state); this.setLocateType(state);
switch (state.status) { switch (state.status) {
case '01': case '01':
this.spare(); /** 空闲*/ this.spare(); /** 空闲*/
break; break;
case '10': case '10':
this.setMonolock(); /** 单锁*/ this.setMonolock(); /** 单锁*/
break; break;
case '13': case '13':
this.timeRelease(); /** 延时释放*/ this.timeRelease(); /** 延时释放*/
break; break;
case '14': case '14':
this.block(); /** 封锁*/ this.block(); /** 封锁*/
break; break;
} }

View File

@ -1,6 +1,6 @@
import deviceType from '../config/deviceType'; import deviceType from '../config/deviceType';
import Link from './Link'; import Link from './Link';
import Section from './section'; import Section from './Section';
import Signal from './Signal'; import Signal from './Signal';
import Switch from './Switch'; import Switch from './Switch';

View File

@ -441,7 +441,7 @@ export default class Section extends Group {
this.setState(state); this.setState(state);
} }
// this.mouseStateRecover(); this.mouseStateRecover();
} }
/** 创建区段*/ /** 创建区段*/