rt-graphic-component/components/packages/Station/THStation.js

48 lines
1.7 KiB
JavaScript
Raw Normal View History

2024-01-11 13:38:16 +08:00
import { JlStation, ConstrolGraphic } from './common/JlStation.js';
import { THConsts } from './common/StationConfig.js';
2024-01-10 15:46:15 +08:00
import { StyleType } from '../../common/common.js';
2024-01-03 13:35:59 +08:00
2024-01-10 15:46:15 +08:00
class THStation extends JlStation {
2024-01-03 13:35:59 +08:00
_ipRtuStusDown = false;
2024-01-10 15:46:15 +08:00
controlGraphic;
2024-01-03 13:35:59 +08:00
constructor() {
2024-01-10 15:46:15 +08:00
super(StyleType.TH);
this.controlGraphic = new ConstrolGraphic();
this.addChild(this.controlGraphic);
2024-01-03 13:35:59 +08:00
}
get states() {
return this.getStates();
}
doRepaint() {
2024-01-10 15:46:15 +08:00
this.controlGraphic.clear();
if (this.datas.hasControl) {
2024-01-03 13:35:59 +08:00
this.controlGraphic.constrolConfig =
2024-01-10 15:46:15 +08:00
THConsts.constrolGraphic.constrolConfig;
2024-01-03 13:35:59 +08:00
this.controlGraphic.stateArrowFillColor =
2024-01-10 15:46:15 +08:00
THConsts.constrolGraphic.inArrowConfig.inArrowFillColorGray;
2024-01-03 13:35:59 +08:00
if (this.states.ipRtuStusInLocalCtrl) {
this.controlGraphic.constrolConfig.forEach((item) => {
if (item.codeText === '站控') {
item.circleFillColor = '0xFFFA0C';
}
else if (item.codeText === '中控') {
item.circleFillColor = '0x808080';
}
});
if (!this.states.ipRtuStusDown) {
this.controlGraphic.stateArrowFillColor ==
2024-01-10 15:46:15 +08:00
THConsts.constrolGraphic.inArrowConfig.inArrowFillColorBlue;
2024-01-03 13:35:59 +08:00
}
}
2024-01-10 15:46:15 +08:00
this.controlGraphic.draw(THConsts);
2024-01-03 13:35:59 +08:00
}
super.doRepaint();
if (this.states.ipRtuStusDown !== this._ipRtuStusDown) {
this._ipRtuStusDown = this.states.ipRtuStusDown;
//this.handleBlueShow();
}
}
}
2024-01-10 15:46:15 +08:00
export { THStation };