调整道岔绘图状态

This commit is contained in:
zyy 2020-09-08 11:19:06 +08:00
parent d19ac59839
commit b8cfb1900e

View File

@ -125,12 +125,9 @@ export default class Switch extends Group {
this.add(this.lossShow);
this.lossShow.hide();
}
// const trapezoidWidth = this.style.Switch.jointImg.trapezoidLength;
const Tspoint1 = [model.intersection.x + directx * width3 + directx * (width2 + width1) - directx * width3, model.intersection.y + directy * switchWidth1];
const Tspoint2 = [model.intersection.x - directx * width3, Tspoint1[1]];
const Tspoint3 = [model.intersection.x - directx * width3, model.intersection.y - directy * switchWidth1];
// const Tspoint2 = [Tspoint1[0] - directx * trapezoidWidth, Tspoint1[1]];
// const Tspoint3 = [Tspoint1[0] - directx * trapezoidWidth, model.intersection.y - directy * switchWidth1];
const Tspoint4 = [model.intersection.x + directx * width3, Tspoint3[1]];
const Tspoint5 = [Tspoint1[0], Tspoint1[1]];
this.sheltertriangle = new ETriangle({ // 岔芯 直角梯形 C
@ -270,7 +267,6 @@ export default class Switch extends Group {
this.sheltertriangle.hide(); // 直角梯形覆盖图形
this.sheltertriangle.setColor(this.style.Section.line.spareColor);
this.sheltertriangle.stopAnimation(false);
// this.rhomboid.hide();
this.setHasTextBorder(0);
this.locShelter.hide(); // 定位覆盖图形
this.relocShelter.hide(); // 反位覆盖图形
@ -308,20 +304,9 @@ export default class Switch extends Group {
}
this.locShelter.hide(); // 定位
this.sheltertriangle.hide();
if (this.style.Switch.sectionAction.flag) { // 哈尔滨线路处理道岔相关区段颜色
this.sheltertriangle.show();
this.setSectionState(this.sheltertriangle, this.model);
} else {
// this.rhomboid.show();
// this.setSectionState(this.rhomboid, 'fill', this.model);
// this.setSectionState(this.sheltertriangle, 'fill', this.model);
}
if (this.style.Switch.core.graphShow) { // 佛山线路显示
// this.sheltertriangle.hide();
this.locShelter.show();
this.locShelter.setColor('#FFFF00');
// this.rhomboid.show();
// this.rhomboid.setColor('#FFFF00');
this.sheltertriangle.show();
this.sheltertriangle.setColor('#FFFF00');
}
@ -482,25 +467,13 @@ export default class Switch extends Group {
}
}
sectionCutOff(section) {
const lineWidth = this.style.Section.line.width;
if (section) {
section.animateStyle(true, [
{ time: 0, styles: { lineWidth: lineWidth } },
{ time: 1000, styles: { stroke: this.style.backgroundColor } },
{ time: 2000, styles: { lineWidth: lineWidth } }
]);
}
}
// 处理岔芯颜色
setSectionState(section, state) {
const sectionC = store.getters['map/getDeviceByCode'](state.sectionCCode);
if (sectionC) {
// 空闲
// section.setColor('fill', this.style.Section.line.spareColor);
// section.setStyle('lineWidth', 0);
// section.setStyle('stroke', this.style.Section.line.spareColor);
// this.sheltertriangle.hide();
section.setStyle({'fill': this.style.Section.line.spareColor});
section.show();
// 道岔保护区段锁闭
if (sectionC.overlapLock) {
section.show();
@ -522,8 +495,7 @@ export default class Switch extends Group {
section.setStyle({'fill': this.style.Section.line.communicationOccupiedColor, 'stroke': this.style.Section.line.communicationOccupiedColor, 'lineWidth': this.style.Section.line.beyondWidth});
}
if (sectionC.cutOff) {
section.show();
// this.sectionCutOff(section);
section.hide();
}
}
}
@ -545,8 +517,9 @@ export default class Switch extends Group {
model.blockade && this.block(); // 道岔封锁
model.singleLock && model.blockade && this.blockMonolock(); // 单锁&锁闭状态
// this.hideSwitchCenter();
this.setSectionState(this.sheltertriangle, this.model);
if (!this.style.Switch.core.graphShow) {
this.setSectionState(this.sheltertriangle, this.model); // 处理岔芯颜色
}
// this.interlockingReserved(); // 联锁预留道岔
if (this.style.Switch.sectionAction.flag) { // 哈尔滨线路处理道岔相关区段颜色