屏蔽门状态调整

This commit is contained in:
joylink_zhaoerwei 2023-10-20 13:17:57 +08:00
parent ae8bb593d4
commit 17fabb401a
3 changed files with 5 additions and 83 deletions

View File

@ -59,76 +59,6 @@ export class rectGraphic extends Container {
this.rectGraphic.clear();
}
}
//子元素--站台旁菱形图标
/* class emergClose extends JlGraphic {
static Type = 'emergClose';
lozenge: Graphics;
deltaTime = 0;
fillColor = PlatformColorEnum.lozengeRed;
constructor() {
super(emergClose.Type);
this.lozenge = new Graphics();
this.addChild(this.lozenge);
}
draw(): void {
const lozenge = this.lozenge;
lozenge.clear();
lozenge.lineStyle(1, new Color(this.fillColor));
lozenge.beginFill(PlatformColorEnum.lozengeRed, 1);
lozenge.drawRect(
0,
0,
platformConsts.height / 4,
platformConsts.height / 4
);
lozenge.endFill();
const rect = new Rectangle(
0,
0,
platformConsts.height / 4,
platformConsts.height / 4
);
lozenge.pivot = getRectangleCenter(rect);
lozenge.rotation = Math.PI / 4;
lozenge.visible = false;
}
doRepaint() {
// this.draw()
}
clear(): void {
this.lozenge.clear();
}
createFlashAnmiation(name: string): GraphicAnimation {
const flashAnmiation = GraphicAnimation.init({
name: name,
run: (dt: number) => {
this.deltaTime += dt;
if (this.deltaTime > 60) {
this.deltaTime = 0;
this.lozenge.visible = false;
} else if (this.deltaTime > 30) {
this.lozenge.visible = true;
}
},
});
return flashAnmiation;
}
changeState(id: string, stateData: IPlatformState): void {
let redFlash = this.animation(`${id}emergClose_red_flash`);
if (stateData.emergstop) {
if (!redFlash) {
redFlash = this.createFlashAnmiation(`${id}emergClose_red_flash`);
this.addAnimation(redFlash);
}
redFlash.resume();
} else {
if (redFlash) {
redFlash.pause();
}
}
}
} */
export class Platform extends JlGraphic {
static Type = 'Platform';
rectGraphic: rectGraphic = new rectGraphic();

View File

@ -56,12 +56,9 @@ export class Relay extends JlGraphic {
this.labelGraphic.position.set(0, 20);
this.refDevice.position.set(0, -20);
const relayGraphic = this.relayGraphic;
let relayColor;
if (this.states?.xh) {
relayColor = relayConsts.closeColor;
} else {
relayColor = relayConsts.openColor;
}
const relayColor = this.states.xh
? relayConsts.closeColor
: relayConsts.openColor;
relayGraphic
.clear()
.lineStyle(relayConsts.lineWidth, new Color(relayColor))

View File

@ -55,16 +55,11 @@ class smallDoorGraphic extends Container {
const lineColor = open
? screenDoorConsts.doorOpen
: screenDoorConsts.doorClose;
const direction = 'up';
smallDoorGraphic
.lineStyle(screenDoorConsts.lineWidth, new Color(lineColor))
.moveTo(start, 0)
.lineTo(start + screenDoorConsts.smallDoorWidth - 3, 0);
if (direction == 'up') {
this.labelGraphic.text = i + 1;
} else {
this.labelGraphic.text = data.sonDoorAmount - i;
}
this.labelGraphic.text = i + 1;
this.labelGraphic.style.fill = 'red';
if (i % 2 == 0) {
this.labelGraphic.position.set(start + 4, 7);
@ -99,7 +94,7 @@ export class ScreenDoor extends JlGraphic {
this.datas.sonDoorAmount = this.datas?.sonDoorAmount || 30;
for (let i = 0; i < this.datas.sonDoorAmount; i++) {
const smallDoor = new smallDoorGraphic();
smallDoor.draw(this.datas, i, this.states.openDoorCodes.includes(i));
smallDoor.draw(this.datas, i, this.states.openDoorCodes.includes(i + 1));
doorGraphic.addChild(smallDoor);
}
}