道岔颜色根据正反位显示 && 道岔和区段增加overlap状态显示

This commit is contained in:
Yuan 2023-07-31 13:49:38 +08:00
parent a3c264312d
commit 14bd3b7b65
3 changed files with 14 additions and 1 deletions

View File

@ -104,6 +104,8 @@ export class LogicSection extends JlGraphic implements ILineGraphic {
lineColor = SectionConsts.failLockedColor;
} else if (this.states.blocked) {
lineColor = SectionConsts.blockedColor;
} else if (this.states.overlap) {
lineColor = SectionConsts.overlapColor;
}
if (this.states.cut) {
this.bindFlashAnimation(this.lineGraphic);

View File

@ -59,6 +59,7 @@ export const SectionConsts = {
lockedColor: '#fff', //锁闭
failLockedColor: '#954', //故障锁闭
blockedColor: '#606', //封锁
overlapColor: '#ff0', //overlap
lineWidth: 5,
};

View File

@ -49,6 +49,7 @@ export const TurnoutConsts = {
cbtcOccupiedColor: '#f49', //通信车占用
lockedColor: '#fff', //锁闭
failLockedColor: '#954', //故障锁闭
overlapColor: '#ff0', //overlap
lineWidth: 5,
forkLenth: 20,
labelFontSize: 12,
@ -114,21 +115,28 @@ export class TurnoutSection extends Graphics {
paint() {
let pList: IPointData[] = [];
let lineColor = this.turnout.lineColor;
switch (this.port) {
case TurnoutPort.A:
pList = this.turnout.datas.pointA;
break;
case TurnoutPort.B:
pList = this.turnout.datas.pointB;
if (!this.turnout.states.ipSingleSwitchStusNormal) {
lineColor = TurnoutConsts.idleColor;
}
break;
case TurnoutPort.C:
pList = this.turnout.datas.pointC;
if (!this.turnout.states.ipSingleSwitchStusReverse) {
lineColor = TurnoutConsts.idleColor;
}
break;
}
const gap = this.port === TurnoutPort.A ? 0 : TurnoutConsts.forkLenth;
const start = getForkPoint(gap, pList[0]);
this.clear()
.lineStyle(TurnoutConsts.lineWidth, this.turnout.lineColor)
.lineStyle(TurnoutConsts.lineWidth, lineColor)
.moveTo(start.x, start.y);
pList.forEach((p) => {
@ -295,6 +303,8 @@ export class Turnout extends JlGraphic {
this.lineColor = TurnoutConsts.lockedColor;
} else if (this.states.ipSingleSwitchStusFailLocked) {
this.lineColor = TurnoutConsts.failLockedColor;
} else if (this.states.ipSingleSwitchStusOverlap) {
this.lineColor = TurnoutConsts.overlapColor;
} else {
this.lineColor = TurnoutConsts.idleColor;
}