This commit is contained in:
joylink_zhaoerwei 2024-01-16 09:43:31 +08:00
parent 0619184b9b
commit b5d778ea24
5 changed files with 13 additions and 70 deletions

View File

@ -1,5 +1,5 @@
import { JlTurnout } from './common/JlTurnout';
export declare class Turnout extends JlTurnout {
static Type: string;
export declare class GPTurnout extends JlTurnout {
constructor();
doRepaint(): void;
}

View File

@ -1,10 +1,13 @@
import { JlTurnout } from './common/JlTurnout.js';
import { GPConsts } from './common/TurnoutConfig.js';
class Turnout extends JlTurnout {
static Type = 'Turnout';
class GPTurnout extends JlTurnout {
constructor() {
super(GPConsts);
}
doRepaint() {
super.draw();
}
}
export { Turnout };
export { GPTurnout };

View File

@ -1,33 +0,0 @@
import { DevicePort, IRelatedRef, KilometerSystem } from 'common/common';
import { GraphicData, JlGraphic } from 'jl-graphic';
import { IPointData } from 'pixi.js';
export declare enum SwitchMachineType {
Unknown = 0,
ZDJ9_Single = 1,
ZDJ9_Double = 2
}
export interface ITurnoutData extends GraphicData {
code: string;
pointA: IPointData[];
pointB: IPointData[];
pointC: IPointData[];
paRef?: IRelatedRef;
pbRef?: IRelatedRef;
pcRef?: IRelatedRef;
kilometerSystem: KilometerSystem;
paTrackSectionId?: number;
pbTrackSectionId?: number;
pcTrackSectionId?: number;
switchMachineType?: SwitchMachineType;
centralizedStations?: number[];
clone(): ITurnoutData;
copyFrom(data: ITurnoutData): void;
eq(other: ITurnoutData): boolean;
}
export declare class Turnout extends JlGraphic {
static Type: string;
doRepaint(): void;
get datas(): ITurnoutData;
getGraphicOfPort(port: DevicePort): JlGraphic[];
getPortPoints(): IPointData[][];
}

View File

@ -1,30 +0,0 @@
import { JlGraphic } from 'jl-graphic';
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 = {}));
class Turnout extends JlGraphic {
static Type = 'Turnout';
doRepaint() {
console.log(111);
}
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];
}
}
export { SwitchMachineType, Turnout };

View File

@ -1,7 +1,10 @@
import { JlTurnout } from './common/JlTurnout';
import { GPConsts } from './common/TurnoutConfig';
export class Turnout extends JlTurnout {
static Type = 'Turnout';
export class GPTurnout extends JlTurnout {
constructor() {
super(GPConsts);
}
doRepaint(): void {
super.draw();
}