rt-graphic-component/components/packages/Station/THStation.js
joylink_zhaoerwei 3c81ca8a83 重新打包
2024-01-11 13:38:16 +08:00

48 lines
1.7 KiB
JavaScript

import { JlStation, ConstrolGraphic } from './common/JlStation.js';
import { THConsts } from './common/StationConfig.js';
import { StyleType } from '../../common/common.js';
class THStation extends JlStation {
_ipRtuStusDown = false;
controlGraphic;
constructor() {
super(StyleType.TH);
this.controlGraphic = new ConstrolGraphic();
this.addChild(this.controlGraphic);
}
get states() {
return this.getStates();
}
doRepaint() {
this.controlGraphic.clear();
if (this.datas.hasControl) {
this.controlGraphic.constrolConfig =
THConsts.constrolGraphic.constrolConfig;
this.controlGraphic.stateArrowFillColor =
THConsts.constrolGraphic.inArrowConfig.inArrowFillColorGray;
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 ==
THConsts.constrolGraphic.inArrowConfig.inArrowFillColorBlue;
}
}
this.controlGraphic.draw(THConsts);
}
super.doRepaint();
if (this.states.ipRtuStusDown !== this._ipRtuStusDown) {
this._ipRtuStusDown = this.states.ipRtuStusDown;
//this.handleBlueShow();
}
}
}
export { THStation };