调整道岔绘图状态

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