rt-graphic-component/components/packages/Turnout/Turnout.js

31 lines
977 B
JavaScript
Raw Normal View History

2023-12-19 14:20:48 +08:00
import { JlGraphic } from 'jl-graphic';
2024-01-09 14:11:27 +08:00
var SwitchMachineType;
(function (SwitchMachineType) {
SwitchMachineType[SwitchMachineType["Unknown"] = 0] = "Unknown";
SwitchMachineType[SwitchMachineType["ZDJ9_Single"] = 1] = "ZDJ9_Single";
SwitchMachineType[SwitchMachineType["ZDJ9_Double"] = 2] = "ZDJ9_Double";
})(SwitchMachineType || (SwitchMachineType = {}));
2023-12-19 14:20:48 +08:00
class Turnout extends JlGraphic {
2024-01-09 14:11:27 +08:00
static Type = 'Turnout';
2023-12-19 14:20:48 +08:00
doRepaint() {
console.log(111);
}
2024-01-09 14:11:27 +08:00
get datas() {
return this.getDatas();
}
getGraphicOfPort(port) {
return this.relationManage
.getRelationsOfGraphic(this)
.filter((relation) => relation.getRelationParam(this).getParam() === port)
.map((relation) => {
return relation.getOtherGraphic(this);
});
}
getPortPoints() {
return [this.datas.pointA, this.datas.pointB, this.datas.pointC];
}
2023-12-19 14:20:48 +08:00
}
2024-01-09 14:11:27 +08:00
export { SwitchMachineType, Turnout };