修改bug

This commit is contained in:
ival 2019-08-06 18:42:18 +08:00
parent 165362dfcb
commit a02a948f17
6 changed files with 29 additions and 11 deletions

View File

@ -308,7 +308,7 @@ class SkinStyle extends defaultStyle {
monolockColor: '#870E10' // 道岔单锁颜色
},
core: {
legnth: 6 // 道岔单边长度
length: 6 // 道岔单边长度
},
monolock: { // 道岔单锁配置
locationColor: '#870E10', // 道岔单锁定位颜色 (红色)

View File

@ -302,7 +302,7 @@ class SkinStyle extends defaultStyle {
monolockColor: '#FFFFFF' // 道岔单锁颜色
},
core: {
legnth: 6 // 道岔单边长度
length: 6 // 道岔单边长度
},
monolock: { // 道岔单锁配置
locationColor: '#00FF00', // 道岔单锁'定位'颜色 (绿色)

View File

@ -281,7 +281,7 @@ class SkinStyle extends defaultStyle {
monolockColor: '#870E10' // 道岔单锁颜色
},
core: {
legnth: 6 // 道岔单边长度
length: 6 // 道岔单边长度
},
block: { // 道岔封锁配置
nameBorderShow: true, // 道岔名称是否有包围框 显示

View File

@ -213,6 +213,7 @@ class Jlmap {
const sectionB = this.mapDevice[swch.sectionBCode];
const sectionC = this.mapDevice[swch.sectionCCode];
if (sectionA && sectionB && sectionC) {
swch['cutOff'] = sectionA.cutOff;
swch['sectionAstatus'] = sectionA.status;
swch['sectionBstatus'] = sectionB.status;
swch['sectionCstatus'] = sectionC.status;

View File

@ -32,7 +32,7 @@ import JTriangle from '../../utils/JTriangle';
// ctx.bezierCurveTo(shape[`cpx1`], shape[`cpy1`], shape[`cpx2`], shape[`cpy2`], shape[`x2`], shape[`y2`]);
// }
// } else {
// const swPadding = model.style.Switch.core.legnth; // 定位和反位时区段距离岔芯的距离
// const swPadding = model.style.Switch.core.length; // 定位和反位时区段距离岔芯的距离
// var switchWidth = model.style.Section.line.width + model.style.Section.line.beyondWidth; // 道岔宽度
// const beg = Object.assign({}, model.points[0]);
// const end = Object.assign({}, model.points[model.points.length - 1]);
@ -117,7 +117,7 @@ export default class ELimitLines extends Group {
// const beg = Object.assign({}, model.points[0]);
// const end = Object.assign({}, model.points[model.points.length - 1]);
const swPadding = model.style.Switch.core.legnth; // 定位和反位时区段距离岔芯的距离
const swPadding = model.style.Switch.core.length; // 定位和反位时区段距离岔芯的距离
var switchWidth = model.style.Section.line.width + model.style.Section.line.beyondWidth; // 道岔宽度
const beg = Object.assign({}, model.points[0]);
const end = Object.assign({}, model.points[model.points.length - 1]);

View File

@ -44,7 +44,7 @@ export default class Switch extends Group {
let halfWidth = style.Section.line.width / 2;
const switchWidth = style.Section.line.width + style.Section.line.beyondWidth*2 + 0.8;
const swPadding = style.Switch.core.legnth;
const swPadding = style.Switch.core.length;
const directx = this.triangle.drictx;
const directy = this.triangle.dricty;
const direct = -this.triangle.drictx * this.triangle.dricty;
@ -213,8 +213,10 @@ export default class Switch extends Group {
this.setSwitchCoreColor(this.style.backgroundColor);
this.name.getNameText().stopAnimation(false);
this.swCore.stopAnimation(false);
if (!this.model.cutOff) {
this.relocShelter.stopAnimation(false);
this.relocShelter.hide();
}
this.releaseBackground.hide();
this.setHasTextBorder(0);
}
@ -235,7 +237,7 @@ export default class Switch extends Group {
this.locShelter.hide();
this.relocShelter.show();
this.setTextColor(this.style.Switch.text.inversionColor);
this.setSectionState(this.relocShelter.getSection(), 'fill', this.model.sectionAstatus);
this.setSectionState(this.relocShelter.getSection(), 'fill', this.model);
}
/** 失去*/
@ -310,9 +312,20 @@ export default class Switch extends Group {
}
}
setSectionState(section, style, model) {
sectionCutOff(section) {
const lineWidth = this.style.Section.line.width + (this.model.sectionAstatus != '01' ? this.style.Section.line.beyondWidth : 0);
if (section) {
switch (model) {
section.animateStyle(true, [
{ time: 0, styles: { lineWidth: lineWidth } },
{ time: 1000, styles: { stroke: this.style.backgroundColor } },
{ time: 2000, styles: { lineWidth: lineWidth } }
]);
}
}
setSectionState(section, style, state) {
if (section) {
switch (state.sectionAstatus) {
case '00': break;
case '01': /** 空闲*/
section.setStyle(style, this.style.Section.line.spareColor);
@ -347,6 +360,10 @@ export default class Switch extends Group {
break;
}
}
if (state.cutOff && !section.animators.length ) {
this.sectionCutOff(section);
}
}
setLocateType(model) {