42 lines
1.1 KiB
JavaScript
42 lines
1.1 KiB
JavaScript
import { JlTurnout } from './common/JlTurnout.js';
|
|
import { GPConsts } from './common/TurnoutConfig.js';
|
|
|
|
class GPTurnout extends JlTurnout {
|
|
constructor() {
|
|
super(GPConsts);
|
|
}
|
|
get states() {
|
|
return this.getStates();
|
|
}
|
|
doRepaint() {
|
|
const { pointB, pointC } = this.datas;
|
|
if (this.states.dw) {
|
|
this.graphics.fork.paint(pointB[0]);
|
|
this.graphics.label.style.stroke = GPConsts.normalLabelColor;
|
|
}
|
|
else if (this.states.fw) {
|
|
this.graphics.fork.paint(pointC[0]);
|
|
this.graphics.label.style.stroke = GPConsts.reverseLabelColor;
|
|
}
|
|
super.draw();
|
|
if (!this.states.dw && !this.states.fw) {
|
|
// 失表
|
|
this.graphics.fork.visible = false;
|
|
}
|
|
else {
|
|
this.graphics.fork.visible = true;
|
|
}
|
|
}
|
|
buildRelation() {
|
|
super.buildCommonRelation();
|
|
}
|
|
saveRelations() {
|
|
super.saveCommonRelations();
|
|
}
|
|
loadRelations() {
|
|
super.loadCommonRelations();
|
|
}
|
|
}
|
|
|
|
export { GPTurnout };
|