diff --git a/components/EsbButton/ThEsbButton.d.ts b/components/EsbButton/ThEsbButton.d.ts deleted file mode 100644 index c09a8e0..0000000 --- a/components/EsbButton/ThEsbButton.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { Graphics } from 'pixi.js'; -import { GraphicData, GraphicState, JlGraphic, VectorText } from 'jl-graphic'; -export interface IEsbButtonData extends GraphicData { - get code(): string; - set code(v: string); - get flip(): boolean; - set flip(v: boolean); -} -export interface IEsbButtonState extends GraphicState { - id: number; - get down(): boolean; - set down(v: boolean); -} -export declare class EsbButton extends JlGraphic { - static Type: string; - codeGraph: VectorText; - circleBody: Graphics; - rectBody: Graphics; - lineBody: Graphics; - constructor(); - get datas(): IEsbButtonData; - get state(): IEsbButtonState; - doRepaint(): void; -} diff --git a/components/EsbButton/ZdwxEsbButton.d.ts b/components/EsbButton/ZdwxEsbButton.d.ts deleted file mode 100644 index 0701a79..0000000 --- a/components/EsbButton/ZdwxEsbButton.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { Graphics } from 'pixi.js'; -import { GraphicData, GraphicState, JlGraphic, VectorText } from 'jl-graphic'; -export interface IZdwxEsbData extends GraphicData { - get code(): string; - set code(v: string); - get flip(): boolean; - set flip(v: boolean); -} -export interface IZdwxEsbState extends GraphicState { - id: number; - get down(): boolean; - set down(v: boolean); -} -export declare const zdwxEsbConsts: { - codeFontSize: number; - codeColor: number; - bodyLineColor: number; - lineWidth: number; - bodyRectLineColor: number; - bodyRectLineWidth: number; - bodyRectWidth: number; - bodyRectHeight: number; - bodyCircleRadius: number; - bodyColor: number; - rectOffset: number; -}; -export declare class ZdwxEsb extends JlGraphic { - static Type: string; - codeGraph: VectorText; - circleBody: Graphics; - constructor(); - get datas(): IZdwxEsbData; - get state(): IZdwxEsbState; - doRepaint(): void; -} diff --git a/components/GatedBox/GatedBox.d.ts b/components/GatedBox/GatedBox.d.ts deleted file mode 100644 index 3bea76d..0000000 --- a/components/GatedBox/GatedBox.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Graphics } from 'pixi.js'; -import { GraphicData, JlGraphic, VectorText } from 'jl-graphic'; -export interface IGatedBox extends GraphicData { - get code(): string; - set code(v: string); - get flip(): boolean; - set flip(v: boolean); - get refScreenDoor(): number; - set refScreenDoor(v: number); - get refGatedBoxMapCode(): string; - set refGatedBoxMapCode(v: string); - clone(): IGatedBox; - copyFrom(data: IGatedBox): void; - eq(other: IGatedBox): boolean; -} -export declare class GatedBox extends JlGraphic { - static Type: string; - codeGraph: VectorText; - rectBody: Graphics; - lineBody: Graphics; - textGraph: VectorText; - constructor(); - get datas(): IGatedBox; - doRepaint(): void; -} diff --git a/components/Platform/BeiJingPlatform.d.ts b/components/Platform/BeiJingPlatform.d.ts deleted file mode 100644 index 0ed08ea..0000000 --- a/components/Platform/BeiJingPlatform.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { GraphicState } from 'jl-graphic'; -import { JlPlatform } from './JlPlatform'; -export interface IBeiJingPlatformState extends GraphicState { - id?: number; -} -export declare class BeiJingPlatform extends JlPlatform { - constructor(); - get states(): IBeiJingPlatformState; - doRepaint(): void; -} diff --git a/components/Platform/JlPlatform.d.ts b/components/Platform/JlPlatform.d.ts deleted file mode 100644 index e0adb25..0000000 --- a/components/Platform/JlPlatform.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { JlGraphic, VectorText } from 'jl-graphic'; -import { Container, Graphics } from 'pixi.js'; -import { CategoryType, IPlatformData, PlatformConstsConfig } from './PlatformConfig'; -declare class RectGraphic extends Container { - categoryType: CategoryType; - rect: Graphics; - stateFillColor?: string; - constructor(categoryType: CategoryType); - draw(platformConsts: PlatformConstsConfig): void; - clear(): void; -} -declare class DoorGraphic extends Container { - categoryType: CategoryType; - doorGraphic: Graphics; - doorCloseGraphic: Graphics; - stateFillColor?: string; - constructor(categoryType: CategoryType); - draw(platformConsts: PlatformConstsConfig): void; - clear(): void; -} -declare class CodeGraphic extends Container { - categoryType: CategoryType; - character: VectorText; - runLevel: VectorText; - runTime: VectorText; - stopTime: VectorText; - circle: Graphics; - constructor(categoryType: CategoryType, platformConsts: PlatformConstsConfig); - draw(platformConsts: PlatformConstsConfig): void; - clear(): void; -} -declare class LozengeGraphic extends Container { - categoryType: CategoryType; - lozenge: Graphics; - constructor(categoryType: CategoryType); - draw(platformConsts: PlatformConstsConfig): void; - clear(): void; -} -export declare abstract class JlPlatform extends JlGraphic { - static Type: string; - private categoryType; - private platformConsts; - rectGraphic: RectGraphic; - doorGraphic?: DoorGraphic; - lozengeGraphic?: LozengeGraphic; - codeGraphic?: CodeGraphic; - constructor(categoryType: CategoryType); - get datas(): IPlatformData; - doRepaint(): void; -} -export {}; diff --git a/components/Platform/PlatformConfig.d.ts b/components/Platform/PlatformConfig.d.ts deleted file mode 100644 index 2b9cd60..0000000 --- a/components/Platform/PlatformConfig.d.ts +++ /dev/null @@ -1,95 +0,0 @@ -import { GraphicData } from 'jl-graphic'; -export declare enum CategoryType { - BeiJing = "BeiJing",//北京 - XiAn = "XiAn" -} -export interface PlatformConstsConfig { - width: number; - height: number; - lineWidth: number; - noTrainStop: string; - trainStop: string; - trainJump: string; - doorGraphic?: DoorConstsConfig; - codeGraphic?: CodeConstsConfig; - lozengeGraphic?: LozengeConstsConfig; -} -export interface DoorConstsConfig { - doorGreen: string; - doorRed: string; - doorBlue: string; - doorOpenSpacing: number; - doorPlatformSpacing: number; -} -export interface CodeConstsConfig { - besideSpacing: number; - besideFontSize: number; - whiteNumbers: string; - whiteCircle: string; - circleRadius: number; - HCharYellow: string; - HCharWhite: string; - HCharRed: string; -} -export interface LozengeConstsConfig { - lozengeRed: string; - doorPlatformSpacing: number; -} -export declare const BeiJingConsts: { - width: number; - height: number; - lineWidth: number; - noTrainStop: string; - trainStop: string; - trainJump: string; -}; -export declare const XiAnConsts: { - width: number; - height: number; - lineWidth: number; - noTrainStop: string; - trainStop: string; - trainJump: string; - doorGraphic: { - doorOpenSpacing: number; - doorGreen: string; - doorRed: string; - doorBlue: string; - doorPlatformSpacing: number; - }; - codeGraphic: { - circleRadius: number; - besideSpacing: number; - besideFontSize: number; - whiteNumbers: string; - whiteCircle: string; - HCharYellow: string; - HCharWhite: string; - HCharRed: string; - }; - lozengeGraphic: { - lozengeRed: string; - doorPlatformSpacing: number; - }; -}; -export declare const platformConstsMap: Map; -declare enum TypeOfPlatform { - Unknown = 0, - up = 1, - down = 2 -} -export interface IPlatformData extends GraphicData { - code: string; - hasdoor?: boolean; - direction?: string; - up?: boolean; - type?: TypeOfPlatform; - centralizedStation?: number; - refStation: number; - refSection: number; - refEsbRelayCode?: string; - clone(): IPlatformData; - copyFrom(data: IPlatformData): void; - eq(other: IPlatformData): boolean; -} -export {}; diff --git a/components/Platform/PlatformDrawAssistant.d.ts b/components/Platform/PlatformDrawAssistant.d.ts deleted file mode 100644 index 837a1c8..0000000 --- a/components/Platform/PlatformDrawAssistant.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { FederatedPointerEvent, Point } from 'pixi.js'; -import { GraphicDrawAssistant, IDrawApp } from 'jl-graphic'; -import { JlPlatform } from './JlPlatform'; -import { PlatformTemplate } from './PlatformTemplate'; -import { IPlatformData } from './PlatformConfig'; -export declare class PlatformDraw extends GraphicDrawAssistant { - platformGraphic: JlPlatform; - constructor(app: IDrawApp, template: PlatformTemplate, icon: string); - bind(): void; - onLeftDown(e: FederatedPointerEvent): void; - redraw(p: Point): void; - prepareData(data: IPlatformData): boolean; -} diff --git a/components/Platform/PlatformTemplate.d.ts b/components/Platform/PlatformTemplate.d.ts deleted file mode 100644 index 73f15ea..0000000 --- a/components/Platform/PlatformTemplate.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { JlGraphicTemplate } from 'jl-graphic'; -import { JlPlatform } from './JlPlatform'; -import { CategoryType, IPlatformData } from './PlatformConfig'; -import { IXiAnPlatformState } from './XiAnPlatform'; -import { IBeiJingPlatformState } from './BeiJingPlatform'; -export declare class PlatformTemplate extends JlGraphicTemplate { - hasdoor?: boolean; - direction?: string; - categoryType: CategoryType; - constructor(dataTemplate: IPlatformData, stateTemplate: IXiAnPlatformState | IBeiJingPlatformState, categoryType: CategoryType); - new(): JlPlatform; -} diff --git a/components/Platform/XiAnPlatform.d.ts b/components/Platform/XiAnPlatform.d.ts deleted file mode 100644 index 55ad485..0000000 --- a/components/Platform/XiAnPlatform.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { GraphicState } from 'jl-graphic'; -import { JlPlatform } from './JlPlatform'; -export interface IXiAnPlatformState extends GraphicState { - get emergstop(): boolean; - set emergstop(v: boolean); - get trainberth(): boolean; - set trainberth(v: boolean); - get close(): boolean; - set close(v: boolean); - get upHold(): boolean; - set upHold(v: boolean); - get downHold(): boolean; - set downHold(v: boolean); - get upOccHold(): boolean; - set upOccHold(v: boolean); - get downOccHold(): boolean; - set downOccHold(v: boolean); - get psdOpen(): boolean; - set psdOpen(v: boolean); - get psdCut(): boolean; - set psdCut(v: boolean); - get upSkipstop(): boolean; - set upSkipstop(v: boolean); - get downSkipstop(): boolean; - set downSkipstop(v: boolean); - get upTrainSkipstop(): boolean; - set upTrainSkipstop(v: boolean); - get downTrainSkipstop(): boolean; - set downTrainSkipstop(v: boolean); - get nextSectionRunTime(): number; - set nextSectionRunTime(v: number); - get nextSectionRunLevel(): number; - set nextSectionRunLevel(v: number); - get stopTime(): number; - set stopTime(v: number); - get rtuId(): number; - set rtuId(v: number); -} -export declare class XiAnPlatform extends JlPlatform { - constructor(); - get states(): IXiAnPlatformState; - doRepaint(): void; -} diff --git a/components/Section/Section.d.ts b/components/Section/Section.d.ts deleted file mode 100644 index 8c60565..0000000 --- a/components/Section/Section.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { GraphicData, JlGraphic } from 'jl-graphic'; -import { IPointData } from 'pixi.js'; -import { SectionGraphic } from './SectionGraphic'; -export interface ISectionData extends GraphicData { - code: string; - points: IPointData[]; -} -export interface SectionDisplayConfig { - lineColor: string; - lineWidth: number; -} -export declare class Section extends JlGraphic { - static Type: string; - lineGraphic: SectionGraphic; - constructor(); - doRepaint(): void; -} diff --git a/components/Section/Section.js b/components/Section/Section.js deleted file mode 100644 index aa53a1a..0000000 --- a/components/Section/Section.js +++ /dev/null @@ -1,18 +0,0 @@ -import { JlGraphic } from 'jl-graphic'; -import { SectionGraphic } from './SectionGraphic.js'; - -class Section extends JlGraphic { - static Type = 'Section'; - lineGraphic; - constructor() { - super(Section.Type); - this.lineGraphic = new SectionGraphic(); - // this.transformSave = true; - this.addChild(this.lineGraphic); - } - doRepaint() { - console.log('repaint'); - } -} - -export { Section }; diff --git a/components/Section/SectionGraphic.d.ts b/components/Section/SectionGraphic.d.ts deleted file mode 100644 index e8bd226..0000000 --- a/components/Section/SectionGraphic.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Graphics, IPointData } from 'pixi.js'; -export declare class SectionGraphic extends Graphics { - static Type: string; - private _points; - get points(): IPointData[]; - set points(value: IPointData[]); - private _segmentsCount; - get segmentsCount(): number; - set segmentsCount(value: number); - isCurve: boolean; - constructor(); - paint(): void; -} diff --git a/components/Separator/Separator.d.ts b/components/Separator/Separator.d.ts deleted file mode 100644 index 79a4ce9..0000000 --- a/components/Separator/Separator.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { Graphics } from 'pixi.js'; -import { JlGraphic, JlGraphicTemplate } from 'jl-graphic'; -import { ISeparatorConsts, ISeparatorData, UpdateSeparatorConsts } from './SeparatorConfig'; -/** - * 分隔符 - * @param {UpdateSeparatorConsts}常量数据 - * - */ -export declare class Separator extends JlGraphic { - static Type: string; - rectGraphic: Graphics; - circleGraphic: Graphics; - constDatas: ISeparatorConsts; - constructor(data?: UpdateSeparatorConsts); - get datas(): ISeparatorData; - clear(): void; - doRepaint(): void; -} -export declare class SeparatorTemplate extends JlGraphicTemplate { - constructor(dataTemplate: ISeparatorData); - new(data?: UpdateSeparatorConsts): Separator; -} diff --git a/components/Separator/SeparatorConfig.d.ts b/components/Separator/SeparatorConfig.d.ts deleted file mode 100644 index 4de62da..0000000 --- a/components/Separator/SeparatorConfig.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { GraphicData } from "jl-graphic"; -export declare enum separatorTypeEnum { - turnout = "turnout",// 道岔分隔符 - endA = "endA",// A端尽头分隔符 - endB = "endB",// B端尽头分隔符 - section = "section" -} -export interface ISeparatorConsts { - height: number; - lineWidth: number; - lineColor: string; - circleColor: string; - radius: number; -} -export type UpdateSeparatorConsts = Partial; -export interface ISeparatorData extends GraphicData { - get code(): string; - set code(v: string); - get separatorType(): string; - set separatorType(v: string); - clone(): ISeparatorData; - copyFrom(data: ISeparatorData): void; - eq(other: ISeparatorData): boolean; -} -export declare function getSeparatorConsts(): ISeparatorConsts; diff --git a/components/Separator/SeparatorDrawAssistant.d.ts b/components/Separator/SeparatorDrawAssistant.d.ts deleted file mode 100644 index 9157dd1..0000000 --- a/components/Separator/SeparatorDrawAssistant.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { FederatedPointerEvent, IHitArea, Point } from 'pixi.js'; -import { GraphicDrawAssistant, GraphicInteractionPlugin, IDrawApp, JlGraphic } from 'jl-graphic'; -import { Separator, SeparatorTemplate } from './Separator'; -import { ISeparatorData, UpdateSeparatorConsts } from './SeparatorConfig'; -export declare class SeparatorDraw extends GraphicDrawAssistant { - SeparatorGraph: Separator; - constructor(app: IDrawApp, template: SeparatorTemplate, data?: UpdateSeparatorConsts); - bind(): void; - onLeftDown(e: FederatedPointerEvent): void; - redraw(p: Point): void; - prepareData(data: ISeparatorData): boolean; -} -export declare class SeparatorGraphicHitArea implements IHitArea { - separator: Separator; - constructor(separator: Separator); - contains(x: number, y: number): boolean; -} -export declare class SeparatorInteraction extends GraphicInteractionPlugin { - static Name: string; - constructor(app: IDrawApp); - static init(app: IDrawApp): SeparatorInteraction; - filter(...grahpics: JlGraphic[]): Separator[] | undefined; - bind(g: Separator): void; - unbind(g: Separator): void; -} diff --git a/components/Signal/bjRtss/LampMainBody.d.ts b/components/Signal/bjRtss/LampMainBody.d.ts deleted file mode 100644 index 00b5f31..0000000 --- a/components/Signal/bjRtss/LampMainBody.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { Graphics, Container } from 'pixi.js'; -import { Lamp } from '../common/Lamp'; -import { Model } from './Signal'; -export declare class LampMainBody extends Container { - static Type: string; - lampNum: number; - lampPost: Graphics; - lamps: Lamp[]; - mirror: boolean; - paint(mt: Model, mirror: boolean): void; - setStateBlueShow(): void; - setStateLogic(): void; - setStateH(): void; - setStateL(): void; - setStateU(): void; - setStateHu(): void; - setStateA(): void; - setStateB(): void; - setStateOff(): void; -} diff --git a/components/Signal/bjRtss/Signal.d.ts b/components/Signal/bjRtss/Signal.d.ts deleted file mode 100644 index 6e04bed..0000000 --- a/components/Signal/bjRtss/Signal.d.ts +++ /dev/null @@ -1,154 +0,0 @@ -import { Graphics } from 'pixi.js'; -import { GraphicData, JlGraphic, GraphicState, JlGraphicTemplate } from 'jl-graphic'; -import { LampMainBody } from './LampMainBody'; -import { SignalCode } from '../common/SignalCode'; -/** 信号机类型 */ -export declare enum Model { - HL = 0,// 红绿灯 - HLU_FU = 1,// 红绿黄,封黄灯,无引导 - HLU_DU_YY = 2,// 红绿黄,不封灯,有单黄,带引导 - HLU_YY = 3,// 红绿黄,不封灯,无单黄,带引导 - HLU_FL_DU_YY = 4,// 红绿黄,封绿灯,有单黄,带引导 - HLU_DU = 5,// 红绿黄,不封灯,有单黄,无引导 - AB = 6,// 蓝白 - HBU_DU = 7 -} -export declare enum Direction { - LEFT = 0, - RIGHT = 1 -} -export declare enum DeviceType { - Section = 0, - Turnout = 1, - TrainWindow = 2, - AxleCounting = 3, - SectionLink = 4, - signal = 5, - station = 6, - ScreenDoor = 7, - SignalFaultAlarm = 8, - Breakers = 9, - PowerScreen = 10 -} -export declare enum Aspect { - Non = 0, - OFF = 1, - L = 2, - H = 3, - U = 4, - HU = 5, - B = 6, - A = 7 -} -export declare enum DevicePort { - A = 0, - B = 1, - C = 2 -} -export interface KilometerSystem { - get coordinateSystem(): string; - set coordinateSystem(v: string); - get kilometer(): number; - set kilometer(v: number); - get direction(): Direction; - set direction(v: Direction); -} -export interface IRelatedRefData { - deviceType: DeviceType; - id: number; - devicePort: DevicePort; -} -export interface ISignalData extends GraphicData { - get code(): string; - set code(v: string); - get mirror(): boolean; - set mirror(v: boolean); - get kilometerSystem(): KilometerSystem; - set kilometerSystem(v: KilometerSystem); - get refDev(): IRelatedRefData; - set refDev(v: IRelatedRefData); - get centralizedStations(): number[]; - set centralizedStations(v: number[]); - get mt(): Model; - set mt(v: Model); - get direction(): Direction; - set direction(v: Direction); - clone(): ISignalData; - copyFrom(data: ISignalData): void; - eq(other: ISignalData): boolean; -} -export interface ISignalState extends GraphicState { - id?: string; - get aspect(): number; - set aspect(v: number); -} -export declare enum SignalColorEnum { - humanControlColor = "0xffff00", - fleetModeColor = "0x00ff00", - blockedColor = "0XFF0000", - defaultCodeColor = "0XFFFFFF", - lampPostColor = "0xFFFFFF", - redLamp = "0XFF0000", - greenLamp = "0X00FF00", - yellowLamp = "0XFFFF00", - whiteLamp = "0XFFFFFF", - blueLamp = "0X0033FF", - closeLamp = "0X000000", - logicModeColor = "0x000000", - lampLineColor = "0x3149c3" -} -export declare const signalConsts: { - fleetModeLength: number; - fleetModeRadius: number; - fleetModeLineWidth: number; - humanControlRadius: number; - codeOffset: number; - codeFontSize: number; - blockedLineWidth: number; - verticalLampPostLength: number; - levelLampPostLength: number; - postLineWidth: number; - lampRadius: number; - logicModeLineWidth: number; - logicModeDistance: number; - lampLineWidth: number; -}; -export declare class Signal extends JlGraphic { - static Type: string; - signalCode: SignalCode; - humanControl: Graphics; - fleetMode: Graphics; - lampMainBody: LampMainBody; - blockedMode: Graphics; - constructor(); - get datas(): ISignalData; - get mirror(): boolean; - set mirror(v: boolean); - get states(): ISignalState; - paint(): void; - doRepaint(): void; - chagneState(): void; - /** 设置状态自动进路 */ - /** 设置状态人工控 */ - /** 设置状态封锁 */ - /** 设置状态红灯 */ - setStateH(): void; - /** 设置状态绿灯 */ - setStateL(): void; - /** 设置状态黄灯 */ - setStateU(): void; - /** 设置状态红黄灯 */ - setStateHu(): void; - /** 设置状态白灯 */ - setStateA(): void; - /** 设置状态蓝灯 */ - setStateB(): void; - /** 设置状态灯位关闭 */ - setStateOff(): void; - buildRelation(): void; - loadRelations(): void; -} -export declare class SignalTemplate extends JlGraphicTemplate { - constructor(dataTemplate: ISignalData, stateTemplate: ISignalState); - new(): Signal; -} diff --git a/components/Signal/bjRtss/SignalDrawAssistant.d.ts b/components/Signal/bjRtss/SignalDrawAssistant.d.ts deleted file mode 100644 index 646c60c..0000000 --- a/components/Signal/bjRtss/SignalDrawAssistant.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { FederatedPointerEvent, IHitArea, Point } from 'pixi.js'; -import { GraphicDrawAssistant, GraphicInteractionPlugin, GraphicTransformEvent, IDrawApp, JlGraphic } from 'jl-graphic'; -import { ISignalData, Signal, SignalTemplate } from './Signal'; -export interface ISignalDrawOptions { - newData: () => ISignalData; -} -export declare class SignalDraw extends GraphicDrawAssistant { - _signal: Signal | null; - constructor(app: IDrawApp, template: SignalTemplate); - get signal(): Signal; - onLeftUp(e: FederatedPointerEvent): void; - redraw(p: Point): void; - prepareData(data: ISignalData): boolean; -} -export declare class SignalGraphicHitArea implements IHitArea { - signal: Signal; - constructor(signal: Signal); - contains(x: number, y: number): boolean; -} -export declare class SignalInteraction extends GraphicInteractionPlugin { - static Name: string; - constructor(app: IDrawApp); - static init(app: IDrawApp): SignalInteraction; - filter(...grahpics: JlGraphic[]): Signal[] | undefined; - bind(g: Signal): void; - unbind(g: Signal): void; - transformstart(e: GraphicTransformEvent): void; - codetransformstart(e: GraphicTransformEvent): void; -} diff --git a/components/Signal/common/CommonGraphics.d.ts b/components/Signal/common/CommonGraphics.d.ts deleted file mode 100644 index 7edcc90..0000000 --- a/components/Signal/common/CommonGraphics.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Graphics } from 'pixi.js'; -/** - * - * @param polygon - * @param x 箭头顶点x坐标 - * @param y 箭头顶点y坐标 - * @param length 箭头长度 - * @param radius 箭头三角半径 - * @param lineWidth 箭头线宽 - * @param mirror 是否镜像翻转 (基于箭头顶点) - */ -export declare function drawArrow(polygon: Graphics, x: number, y: number, length: number, radius: number, lineWidth: number, mirror: boolean): void; diff --git a/components/Signal/common/Lamp.d.ts b/components/Signal/common/Lamp.d.ts deleted file mode 100644 index 7780012..0000000 --- a/components/Signal/common/Lamp.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Container } from '@pixi/display'; -import { Graphics } from 'pixi.js'; -export declare class Lamp extends Container { - circleLamp: Graphics; - logicMode: Graphics; - radiusX: number; - radiusY: number; - constructor(hasLogic: boolean); - paint(radiusX: number, radiusY: number): void; - createLampBad(): void; - createLamp(color?: string): void; - createLogicMode(): void; - logicModeClear(): void; - lampClear(): void; -} diff --git a/components/Signal/common/SignalCode.d.ts b/components/Signal/common/SignalCode.d.ts deleted file mode 100644 index a5047d0..0000000 --- a/components/Signal/common/SignalCode.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Container, Graphics } from 'pixi.js'; -import { VectorText } from 'jl-graphic'; -import { ISignalData } from '../bjRtss/Signal'; -export declare class SignalCode extends Container { - blockedMode: Graphics; - codeGraph: VectorText; - name: string; - constructor(); - paint(datas: ISignalData): void; - createBlockedMode(): void; -} diff --git a/components/Signal/th/LampMainBody.d.ts b/components/Signal/th/LampMainBody.d.ts deleted file mode 100644 index baa3d0a..0000000 --- a/components/Signal/th/LampMainBody.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Graphics, Container } from 'pixi.js'; -import { GraphicAnimation } from 'jl-graphic'; -import { Lamp } from '../common/Lamp'; -import { Model } from './Signal'; -export declare class LampMainBody extends Container { - static Type: string; - lampNum: number; - lampPost: Graphics; - lamps: Lamp[]; - mirror: boolean; - deltaTime: number; - constructor(); - paint(mt: Model, mirror: boolean): void; - setStateBlueShow(): void; - setStateLampBad(): void; - setStateLogic(): void; - setStateH(): void; - setStateL(): void; - setStateU(): void; - setStateHu(): void; - setStateA(): void; - setStateB(): void; - setStateOff(): void; - createFlashAnmiation(name: string, color: string, lampIndex: number): GraphicAnimation; -} diff --git a/components/Signal/th/Signal.d.ts b/components/Signal/th/Signal.d.ts deleted file mode 100644 index 811a4e3..0000000 --- a/components/Signal/th/Signal.d.ts +++ /dev/null @@ -1,112 +0,0 @@ -import { GraphicData, JlGraphic } from 'jl-graphic'; -import { Graphics } from 'pixi.js'; -import { SignalCode } from '../common/SignalCode'; -import { LampMainBody } from './LampMainBody'; -/** 信号机类型 */ -export declare enum Model { - HL = 0,// 红绿灯 - HLU_FU = 1,// 红绿黄,封黄灯,无引导 - HLU_DU_YY = 2,// 红绿黄,不封灯,有单黄,带引导 - HLU_YY = 3,// 红绿黄,不封灯,无单黄,带引导 - HLU_FL_DU_YY = 4,// 红绿黄,封绿灯,有单黄,带引导 - HLU_DU = 5,// 红绿黄,不封灯,有单黄,无引导 - AB = 6,// 蓝白 - HBU_DU = 7 -} -/** 信号机颜色 */ -export declare enum SignalColorEnum { - humanControlColor = "0xffff00", - fleetModeColor = "0x00ff00", - blockedColor = "0XFF0000", - defaultCodeColor = "0XFFFFFF", - lampPostColor = "0xFFFFFF", - redLamp = "0XFF0000", - greenLamp = "0X00FF00", - yellowLamp = "0XFFFF00", - whiteLamp = "0XFFFFFF", - blueLamp = "0X0033FF", - closeLamp = "0X000000", - logicModeColor = "0x000000", - lampLineColor = "0x3149c3" -} -/** 信号机常量 */ -export declare const signalConsts: { - fleetModeLength: number; - fleetModeRadius: number; - fleetModeLineWidth: number; - humanControlRadius: number; - codeOffset: number; - codeFontSize: number; - blockedLineWidth: number; - verticalLampPostLength: number; - levelLampPostLength: number; - postLineWidth: number; - lampRadius: number; - logicModeLineWidth: number; - logicModeDistance: number; - lampLineWidth: number; -}; -export interface ISignalData extends GraphicData { - code: string; - mirror: boolean; - mt: Model; -} -export declare class Signal extends JlGraphic { - static Type: string; - datas: ISignalData; - signalCode: SignalCode; - humanControl: Graphics; - fleetMode: Graphics; - lampMainBody: LampMainBody; - blockedMode: Graphics; - constructor(datas: ISignalData); - doRepaint(): void; - stopAnmiation(): void; - /** 设置状态自动进路 */ - setStateFleetMode(): void; - /** 设置状态人工控 */ - setStateHumanControl(): void; - /** 设置状态封锁 */ - setStateBlocked(): void; - /** 设置状态蓝显 */ - setStateBlueShow(): void; - /** 设置状态信号机损坏 */ - setStateSignalBad(): void; - /** 设置状态逻辑点灯 */ - setStateLogic(): void; - /** 设置状态红灯 */ - setStateH(): void; - /** 设置状态绿灯 */ - setStateL(): void; - /** 设置状态黄灯 */ - setStateU(): void; - /** 设置状态红黄灯 */ - setStateHu(): void; - /** 设置状态白灯 */ - setStateA(): void; - /** 设置状态蓝灯 */ - setStateB(): void; - /** 设置状态灯位关闭 */ - setStateOff(): void; - /** 设置状态红闪 */ - setStateRedFlash(): void; - /** 设置状态绿闪 */ - setStateGreenFlash(): void; - /** 设置状态黄闪 */ - setStateYellowFlash(): void; - /** 设置状态蓝闪 */ - setStateBlueFlash(): void; - /** 设置状态白闪 */ - setStateWhiteFlash(): void; -} -/** - * - * @param polygon - * @param x 箭头顶点x坐标 - * @param y 箭头顶点y坐标 - * @param length 箭头长度 - * @param radius 箭头三角半径 - * @param lineWidth 箭头线宽 - * @param mirror 是否镜像翻转 (基于箭头顶点) - */ -export declare function drawArrow(polygon: Graphics, x: number, y: number, length: number, radius: number, lineWidth: number, mirror: boolean): void; diff --git a/components/SpksSwitch/SpksSwitch.d.ts b/components/SpksSwitch/SpksSwitch.d.ts deleted file mode 100644 index 1f7caa4..0000000 --- a/components/SpksSwitch/SpksSwitch.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Graphics } from 'pixi.js'; -import { GraphicData, JlGraphic, VectorText } from 'jl-graphic'; -export interface ISpksSwitchData extends GraphicData { - code: string; - flip: boolean; -} -export declare class SpksSwitch extends JlGraphic { - static Type: string; - datas: ISpksSwitchData; - codeGraph: VectorText; - rectBody: Graphics; - lineBody: Graphics; - textGraph: VectorText; - constructor(datas: ISpksSwitchData); - doRepaint(): void; -} diff --git a/components/Station/BeiJingStation.d.ts b/components/Station/BeiJingStation.d.ts deleted file mode 100644 index 0d9f8ea..0000000 --- a/components/Station/BeiJingStation.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { GraphicState } from 'jl-graphic'; -import { JlStation } from './JlStation'; -export interface IBeiJingStationState extends GraphicState { - id: number; -} -export declare class BeiJingStation extends JlStation { - constructor(); - get states(): IBeiJingStationState; - doRepaint(): void; -} diff --git a/components/Station/JlStation.d.ts b/components/Station/JlStation.d.ts deleted file mode 100644 index 2715df0..0000000 --- a/components/Station/JlStation.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { Container, Point } from 'pixi.js'; -import { JlGraphic, VectorText } from 'jl-graphic'; -import { ConstrolConstsConfig, ConstrolItemConfig, IStationData, StationConstsConfig } from './StationConfig'; -import { CategoryType } from '../Platform/PlatformConfig'; -declare class ConstrolGraphic extends Container { - categoryType: CategoryType; - constrolConfig?: ConstrolItemConfig[]; - stateArrowFillColor?: string; - constructor(categoryType: CategoryType); - draw(stationConsts: StationConstsConfig): void; - drawCircleCode(constrolConsts: ConstrolConstsConfig, code: string, circleFillColor: string, codeGraphFillColor: string, pos: { - circlePs: Point; - codeGraphPs: Point; - }): void; - clear(): void; -} -export declare abstract class JlStation extends JlGraphic { - static Type: string; - private categoryType; - private stationConsts; - codeGraph: VectorText; - kilometerGraph: VectorText; - controlGraphic?: ConstrolGraphic; - constructor(categoryType: CategoryType); - get datas(): IStationData; - get code(): string; - doRepaint(): void; -} -export {}; diff --git a/components/Station/StationConfig.d.ts b/components/Station/StationConfig.d.ts deleted file mode 100644 index 9a9585d..0000000 --- a/components/Station/StationConfig.d.ts +++ /dev/null @@ -1,107 +0,0 @@ -import { GraphicData } from 'jl-graphic'; -import { CategoryType } from '../Platform/PlatformConfig'; -export interface StationConstsConfig { - codeColor: string; - codeFontSize: number; - kilometerCodeColor: string; - kilometerCodeFontSize: number; - kilometerCodeOffsetY: number; - constrolGraphic?: ConstrolConstsConfig; -} -export interface ConstrolConstsConfig { - radius: number; - borderWidth: number; - codeControlFontSize: number; - codeOffsetY: number; - circleOffsetY: number; - circleBetweenOffset: number; - constrolConfig: ConstrolItemConfig[]; - inArrowConfig?: InArrowConfig; -} -export interface ConstrolItemConfig { - codeText: string; - circleFillColor: string; - codeGraphFillColor: string; -} -export interface InArrowConfig { - inArrowFillColorGray: string; - inArrowFillColorBlue: string; -} -export declare const BeiJingConsts: { - codeColor: string; - codeFontSize: number; - kilometerCodeColor: string; - kilometerCodeFontSize: number; - kilometerCodeOffsetY: number; -}; -export declare const XiAnConsts: { - codeColor: string; - codeFontSize: number; - kilometerCodeColor: string; - kilometerCodeFontSize: number; - kilometerCodeOffsetY: number; - constrolGraphic: { - radius: number; - borderWidth: number; - codeControlFontSize: number; - codeOffsetY: number; - circleOffsetY: number; - circleBetweenOffset: number; - constrolConfig: { - codeText: string; - circleFillColor: string; - codeGraphFillColor: string; - }[]; - inArrowConfig: { - inArrowFillColorGray: string; - inArrowFillColorBlue: string; - }; - }; -}; -export declare const otherConsts: { - codeColor: string; - codeFontSize: number; - kilometerCodeColor: string; - kilometerCodeFontSize: number; - kilometerCodeOffsetY: number; - constrolGraphic: { - radius: number; - borderWidth: number; - codeControlFontSize: number; - codeOffsetY: number; - circleOffsetY: number; - circleBetweenOffset: number; - constrolConfig: { - codeText: string; - circleFillColor: string; - codeGraphFillColor: string; - }[]; - }; -}; -export declare const stationConstsMap: Map; -export interface IStationData extends GraphicData { - code: string; - stationName?: string; - kilometerSystem: KilometerSystem; - hasControl?: boolean; - concentrationStations: boolean; - name: string; - manageStations: number[]; - depots: boolean; - refIbpMapCode?: string; - clone(): IStationData; - copyFrom(data: IStationData): void; - eq(other: IStationData): boolean; -} -export interface KilometerSystem { - get coordinateSystem(): string; - set coordinateSystem(v: string); - get kilometer(): number; - set kilometer(v: number); - get direction(): Direction; - set direction(v: Direction); -} -export declare enum Direction { - LEFT = 0, - RIGHT = 1 -} diff --git a/components/Station/StationDrawAssistant.d.ts b/components/Station/StationDrawAssistant.d.ts deleted file mode 100644 index 72fcdb1..0000000 --- a/components/Station/StationDrawAssistant.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { FederatedPointerEvent, Point } from 'pixi.js'; -import { GraphicDrawAssistant, GraphicInteractionPlugin, IDrawApp, JlGraphic } from 'jl-graphic'; -import { JlStation } from './JlStation'; -import { IStationData } from './StationConfig'; -import { StationTemplate } from './StationTemplate'; -export declare class StationDraw extends GraphicDrawAssistant { - codeGraph: JlStation; - constructor(app: IDrawApp, template: StationTemplate, icon: string); - bind(): void; - onLeftDown(e: FederatedPointerEvent): void; - redraw(p: Point): void; - prepareData(data: IStationData): boolean; -} -export declare class StationInteraction extends GraphicInteractionPlugin { - static Name: string; - constructor(app: IDrawApp); - static init(app: IDrawApp): StationInteraction; - filter(...grahpics: JlGraphic[]): JlStation[] | undefined; - bind(g: JlStation): void; - unbind(g: JlStation): void; - onSelected(): void; -} diff --git a/components/Station/StationTemplate.d.ts b/components/Station/StationTemplate.d.ts deleted file mode 100644 index 83dc3cf..0000000 --- a/components/Station/StationTemplate.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { JlGraphicTemplate } from 'jl-graphic'; -import { JlStation } from './JlStation'; -import { IStationData } from './StationConfig'; -import { IXiAnStationState } from './XiAnStation'; -import { IBeiJingStationState } from './BeiJingStation'; -import { CategoryType } from '../Platform/PlatformConfig'; -export declare class StationTemplate extends JlGraphicTemplate { - hasControl?: boolean; - categoryType: CategoryType; - constructor(dataTemplate: IStationData, stateTemplate: IXiAnStationState | IBeiJingStationState, categoryType: CategoryType); - new(): JlStation; -} diff --git a/components/Station/XiAnStation.d.ts b/components/Station/XiAnStation.d.ts deleted file mode 100644 index 4f4b6e1..0000000 --- a/components/Station/XiAnStation.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { GraphicState } from 'jl-graphic'; -import { JlStation } from './JlStation'; -export interface IXiAnStationState extends GraphicState { - get ipRtuStusDown(): boolean; - set ipRtuStusDown(v: boolean); - get ipRtuStusInLocalCtrl(): boolean; - set ipRtuStusInLocalCtrl(v: boolean); - get ipRtuStusInCentralCtrl(): boolean; - set ipRtuStusInCentralCtrl(v: boolean); - get ipRtuStusInEmergencyCtrl(): boolean; - set ipRtuStusInEmergencyCtrl(v: boolean); - get rtuId(): number; - set rtuId(v: number); -} -export declare class XiAnStation extends JlStation { - _ipRtuStusDown: boolean; - constructor(); - get states(): IXiAnStationState; - doRepaint(): void; -} diff --git a/components/Train/Train.d.ts b/components/Train/Train.d.ts deleted file mode 100644 index ffcd04a..0000000 --- a/components/Train/Train.d.ts +++ /dev/null @@ -1,70 +0,0 @@ -import { Graphics, Container } from 'pixi.js'; -import { JlGraphic, JlGraphicTemplate, VectorText } from 'jl-graphic'; -import { ITrainConstsConfig, EnumDiriveModel, EnumStatusText, UpdateTrainConsts, EnumTrainType, ITrainData } from './TrainConfig'; -interface bodyWH { - width: number; - height: number; -} -declare class TrainHead extends Container { - arrow: Graphics; - pause: Graphics; - train: Train; - isStop: boolean; - arrowColor: string; - pauseColor: string; - constructor(train: Train); - clear(): void; - doRepaint(): void; - isRight(): boolean; -} -declare class TrainBody extends Container { - bodyRact: Graphics; - codeAGraph: VectorText; - codeBGraph: VectorText; - train: Train; - codeAColor: string; - codeBColor: string; - codeAText: string; - codeBText: string; - constructor(train: Train); - clear(): void; - getBodyWH(): bodyWH; - doRepaint(): void; -} -declare class StatusText extends Container { - sText: VectorText; - train: Train; - constructor(train: Train); - doRepaint(text: EnumStatusText, bodyWH: bodyWH): void; - clear(): void; -} -/** - * 列车 - */ -export declare class Train extends JlGraphic { - static Type: string; - trainHead: TrainHead; - trainbody: TrainBody; - statusTextMap: Map; - isRightRoTop: boolean; - constDatas: ITrainConstsConfig; - constructor(data?: UpdateTrainConsts); - get datas(): ITrainData; - doRepaint(): void; - setIsStop(v: boolean): void; - setArrowVisible(v: boolean): void; - setPauseVisible(v: boolean): void; - run(): void; - stop(): void; - setCodeAText(v: string): void; - setCodeBText(v: string): void; - setDiriveModelColor(s: EnumDiriveModel): void; - setTrainTypeColor(s: EnumTrainType): void; - showStatus(s: EnumStatusText): void; - hideStatus(s: EnumStatusText): void; -} -export declare class TrainTemplate extends JlGraphicTemplate { - constructor(stateTemplate: any); - new(data?: UpdateTrainConsts): Train; -} -export {}; diff --git a/components/Train/TrainConfig.d.ts b/components/Train/TrainConfig.d.ts deleted file mode 100644 index f732a86..0000000 --- a/components/Train/TrainConfig.d.ts +++ /dev/null @@ -1,64 +0,0 @@ -import { GraphicData } from "jl-graphic"; -export interface ITrainConstsConfig { - bodyWidth: number; - bodyHeight: number; - bodyPadding: number; - borderWidth: number; - codeFontSize: number; - textFontSize: number; - textMarginY: number; - statusTextList: EnumStatusText[]; - marginX: number; - pauseW: number; - bodyBgColor?: string; - codeColor: string; - borderColor: string; - arrowDefaultColor: string; - pauseDefaultColor: string; - DiriveModelColorEnum: DiriveModelColor; - typeColorEnum: TypeColor; - statusTextColor: IStatusTextColor; - statusTextTransform?: IStatusTextColor; - arrowPauseOnlyOne: boolean; - hasBodyRact: boolean; -} -export type UpdateTrainConsts = Partial; -export declare enum EnumDiriveModel { - AM = "AM",// ATO自动驾驶 - SM = "SM",// ATP 监控下的人工驾驶模式 - RM = "RM",// 限制人工驾驶模式 - NRM = "NRM",// 非限制人工驾驶模式 - red = "red" -} -export type DiriveModelColor = { - [key in EnumDiriveModel]: string; -}; -export declare enum EnumTrainType { - accuracy = "accuracy",// 准点 - early = "early",// 早点 - late = "late",// 晚点 - schedule = "schedule",// 计划车 - head = "head",// 头码车 - manual = "manual",// 人工车 - special = "special" -} -export type TypeColor = { - [key in EnumTrainType]: string; -}; -export declare enum EnumStatusText { - H = "H",// H扣车 - S = "S",// S跳停 - D = "D",// D开门 - A = "A" -} -export type IStatusTextColor = { - [key in EnumStatusText]: string; -}; -export interface ITrainData extends GraphicData { - get code(): string; - set code(v: string); - clone(): ITrainData; - copyFrom(data: ITrainData): void; - eq(other: ITrainData): boolean; -} -export declare function getTrainConsts(): ITrainConstsConfig; diff --git a/components/Transponder/Transponder.d.ts b/components/Transponder/Transponder.d.ts deleted file mode 100644 index 69ed3b5..0000000 --- a/components/Transponder/Transponder.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { Container, Graphics } from 'pixi.js'; -import { JlGraphic, JlGraphicTemplate, VectorText } from 'jl-graphic'; -import { ITransponderData, ITransponderConsts, UpdateTransponderConsts } from './TransponderConfig'; -export declare class TransponderCode extends Container { - codeText: VectorText; - name: string; - constructor(); - clear(): void; - paint(datas: ITransponderData): void; -} -export declare class Transponder extends JlGraphic { - static Type: string; - polygonGraphic: Graphics; - labelGraphic: TransponderCode; - constDatas: ITransponderConsts; - constructor(data?: UpdateTransponderConsts); - get datas(): ITransponderData; - clear(): void; - doRepaint(): void; -} -export declare class TransponderTemplate extends JlGraphicTemplate { - constructor(dataTemplate: ITransponderData); - new(data?: UpdateTransponderConsts): Transponder; -} diff --git a/components/Transponder/TransponderConfig.d.ts b/components/Transponder/TransponderConfig.d.ts deleted file mode 100644 index 03e7d4f..0000000 --- a/components/Transponder/TransponderConfig.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { GraphicData } from 'jl-graphic'; -export interface ITransponderData extends GraphicData { - get code(): string; - set code(v: string); - get centralizedStations(): number[]; - set centralizedStations(v: number[]); - get fixedTelegram(): Uint8Array; - set fixedTelegram(v: Uint8Array); - get type(): TransponderTypeEnum; - set type(v: TransponderTypeEnum); - clone(): ITransponderData; - copyFrom(data: ITransponderData): void; - eq(other: ITransponderData): boolean; -} -export declare enum TransponderTypeEnum { - FB = 0,// 固定应答器 - WB = 1,// 轮径校正应答器 - DB = 2,// 休眠唤醒应答器 - VB = 3,// 主信号应答器 - IB = 4 -} -export interface ITransponderConsts { - height: number; - lineWidth: number; - lineColor: string; - wblineColor: string; - textFontSize: number; - textMarginY: number; - vblineColor: string; - iblineColor: string; -} -export declare function getTypePoints(type: TransponderTypeEnum, TrConsts: ITransponderConsts): number[][]; -export type UpdateTransponderConsts = Partial; -export declare function getTransponderConsts(): { - height: number; - lineWidth: number; - lineColor: string; - wblineColor: string; - textFontSize: number; - textMarginY: number; - vblineColor: string; - iblineColor: string; -}; diff --git a/components/Transponder/TransponderDrawAssistant.d.ts b/components/Transponder/TransponderDrawAssistant.d.ts deleted file mode 100644 index 0fccdef..0000000 --- a/components/Transponder/TransponderDrawAssistant.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { FederatedPointerEvent, Point } from 'pixi.js'; -import { GraphicDrawAssistant, GraphicInteractionPlugin, GraphicTransformEvent, IDrawApp, JlGraphic } from 'jl-graphic'; -import { Transponder, TransponderTemplate } from './Transponder'; -import { ITransponderData, UpdateTransponderConsts } from './TransponderConfig'; -export declare class TransponderDraw extends GraphicDrawAssistant { - TransponderGraph: Transponder; - constructor(app: IDrawApp, template: TransponderTemplate, data?: UpdateTransponderConsts); - bind(): void; - onLeftDown(e: FederatedPointerEvent): void; - redraw(p: Point): void; - prepareData(data: ITransponderData): boolean; -} -export declare class TransponderInteraction extends GraphicInteractionPlugin { - static Name: string; - constructor(app: IDrawApp); - static init(app: IDrawApp): TransponderInteraction; - filter(...grahpics: JlGraphic[]): Transponder[] | undefined; - bind(g: Transponder): void; - unbind(g: Transponder): void; - transformstart(e: GraphicTransformEvent): void; - codetransformstart(e: GraphicTransformEvent): void; -} diff --git a/components/Turnout/Turnout.d.ts b/components/Turnout/Turnout.d.ts deleted file mode 100644 index 1d59c65..0000000 --- a/components/Turnout/Turnout.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { JlGraphic } from "jl-graphic"; -export declare class Turnout extends JlGraphic { - doRepaint(): void; -} diff --git a/components/packages/AxleCounting/AxleCounting.js b/components/packages/AxleCounting/AxleCounting.js new file mode 100644 index 0000000..4f410f2 --- /dev/null +++ b/components/packages/AxleCounting/AxleCounting.js @@ -0,0 +1,19 @@ +import { JlGraphic } from 'jl-graphic'; + +var TypeDetectionPoint; +(function (TypeDetectionPoint) { + TypeDetectionPoint[TypeDetectionPoint["AxleCounting"] = 0] = "AxleCounting"; + TypeDetectionPoint[TypeDetectionPoint["SectionBoundary"] = 1] = "SectionBoundary"; +})(TypeDetectionPoint || (TypeDetectionPoint = {})); +class AxleCounting extends JlGraphic { + static Type = 'axleCounting'; + constructor() { + super(AxleCounting.Type); + } + doRepaint() { } + get datas() { + return this.getDatas(); + } +} + +export { AxleCounting }; diff --git a/components/EsbButton/ThEsbButton.js b/components/packages/EsbButton/ThEsbButton.js similarity index 100% rename from components/EsbButton/ThEsbButton.js rename to components/packages/EsbButton/ThEsbButton.js diff --git a/components/EsbButton/ZdwxEsbButton.js b/components/packages/EsbButton/ZdwxEsbButton.js similarity index 100% rename from components/EsbButton/ZdwxEsbButton.js rename to components/packages/EsbButton/ZdwxEsbButton.js diff --git a/components/GatedBox/GatedBox.js b/components/packages/GatedBox/GatedBox.js similarity index 100% rename from components/GatedBox/GatedBox.js rename to components/packages/GatedBox/GatedBox.js diff --git a/components/Platform/BeiJingPlatform.js b/components/packages/Platform/BeiJingPlatform.js similarity index 100% rename from components/Platform/BeiJingPlatform.js rename to components/packages/Platform/BeiJingPlatform.js diff --git a/components/Platform/JlPlatform.js b/components/packages/Platform/JlPlatform.js similarity index 100% rename from components/Platform/JlPlatform.js rename to components/packages/Platform/JlPlatform.js diff --git a/components/Platform/PlatformConfig.js b/components/packages/Platform/PlatformConfig.js similarity index 100% rename from components/Platform/PlatformConfig.js rename to components/packages/Platform/PlatformConfig.js diff --git a/components/Platform/PlatformDrawAssistant.js b/components/packages/Platform/PlatformDrawAssistant.js similarity index 100% rename from components/Platform/PlatformDrawAssistant.js rename to components/packages/Platform/PlatformDrawAssistant.js diff --git a/components/Platform/PlatformTemplate.js b/components/packages/Platform/PlatformTemplate.js similarity index 100% rename from components/Platform/PlatformTemplate.js rename to components/packages/Platform/PlatformTemplate.js diff --git a/components/Platform/XiAnPlatform.js b/components/packages/Platform/XiAnPlatform.js similarity index 100% rename from components/Platform/XiAnPlatform.js rename to components/packages/Platform/XiAnPlatform.js diff --git a/components/packages/Section/bjrtss/Section.js b/components/packages/Section/bjrtss/Section.js new file mode 100644 index 0000000..110d4e4 --- /dev/null +++ b/components/packages/Section/bjrtss/Section.js @@ -0,0 +1,15 @@ +import { Section as Section$1 } from '../common/Section.js'; + +const displayConfig = { + lineColor: '#5578b6', + occupiedColor: '#f00', + lineWidth: 5 +}; +class Section extends Section$1 { + constructor() { + super(); + this.setDisplayConfig(displayConfig); + } +} + +export { Section }; diff --git a/components/packages/Section/common/Section.js b/components/packages/Section/common/Section.js new file mode 100644 index 0000000..8041d5d --- /dev/null +++ b/components/packages/Section/common/Section.js @@ -0,0 +1,230 @@ +import { JlGraphic, VectorText, convertToBezierParams, Vector2, splitLineEvenly, distance2, GraphicRelationParam, JlGraphicTemplate } from 'jl-graphic'; +import { SectionGraphic } from './SectionGraphic.js'; +import { DevicePort, IRelatedRef } from '../../../common/common.js'; +import { Turnout } from '../../Turnout/Turnout.js'; +import { AxleCounting } from '../../AxleCounting/AxleCounting.js'; + +const tolerance = 0.01; +var SectionType; +(function (SectionType) { + SectionType[SectionType["Physical"] = 0] = "Physical"; + SectionType[SectionType["Logic"] = 1] = "Logic"; + SectionType[SectionType["TurnoutPhysical"] = 2] = "TurnoutPhysical"; + SectionType[SectionType["Track"] = 4] = "Track"; + SectionType[SectionType["TrackLogic"] = 5] = "TrackLogic"; +})(SectionType || (SectionType = {})); +const defaultDisplayConfig = { + lineColor: '#5578b6', + occupiedColor: '#f00', + lineWidth: 5, +}; +let Section$1 = class Section extends JlGraphic { + static Type = 'Section'; + lineGraphic; + labelGraphic; + displayConfig = defaultDisplayConfig; + constructor() { + super(Section.Type); + this.lineGraphic = new SectionGraphic(); + this.labelGraphic = new VectorText(''); + this.labelGraphic.setVectorFontSize(14); + this.labelGraphic.anchor.set(0.5); + this.labelGraphic.style.fill = '#0f0'; + this.labelGraphic.transformSave = true; + this.labelGraphic.name = 'label'; + this.transformSave = true; + this.addChild(this.lineGraphic); + this.addChild(this.labelGraphic); + } + setDisplayConfig(config) { + this.displayConfig = config; + } + getVerticesList() { + if (this.datas.isCurve) { + return [ + this.datas.points[0], + ...convertToBezierParams(this.datas.points).map((param) => param.p2), + ]; + } + else { + return this.datas.points; + } + } + getStartPoint() { + return this.datas.points[0]; + } + getEndPoint() { + return this.datas.points[this.datas.points.length - 1]; + } + doRepaint() { + this.lineGraphic.clear(); + if (this.datas.sectionType === SectionType.TurnoutPhysical) { + return; + } + this.lineGraphic.isCurve = this.datas.isCurve; + if (this.lineGraphic.isCurve) { + this.lineGraphic.segmentsCount = this.datas.segmentsCount; + } + this.lineGraphic.points = this.datas.points; + this.lineGraphic.lineStyle(this.displayConfig.lineWidth, this.states.occupied + ? this.displayConfig.occupiedColor + : this.displayConfig.lineColor); + this.labelGraphic.text = this.datas.code; + const labelPosition = this.datas.childTransforms?.find((t) => t.name === this.labelGraphic.name)?.transform.position; + if (labelPosition) { + this.labelGraphic.position.set(labelPosition.x, labelPosition.y); + } + else { + this.labelGraphic.position.set(this.datas.points[0].x, this.datas.points[0].y + 20); + } + } + get datas() { + return this.getDatas(); + } + get states() { + return this.getStates(); + } + get linePoints() { + return this.datas.points; + } + set linePoints(points) { + const old = this.datas.clone(); + old.points = points; + this.updateData(old); + } + getConnectElement(port) { + const relation = this.relationManage + .getRelationsOfGraphic(this) + .find((relation) => relation.getRelationParam(this).getParam() === port && + (relation.getOtherGraphic(this) instanceof Section || + relation.getOtherGraphic(this) instanceof Turnout)); + if (!relation) { + return; + } + return { + g: relation?.getOtherGraphic(this), + port: relation?.getOtherRelationParam(this).getParam(), + }; + } + /** 获取拆分逻辑区段数据 */ + getSplitPoints(count) { + if (this.datas.points.length !== 2) { + let totalLen = 0; + const lengths = []; + for (let i = 1; i < this.datas.points.length; i++) { + const { x: x1, y: y1 } = this.datas.points[i - 1], { x: x2, y: y2 } = this.datas.points[i]; + const len = new Vector2([x2 - x1, y2 - y1]).length(); + totalLen += len; + lengths.push(len); + } + const counts = lengths.map((length) => Math.round((count * length) / totalLen)); + if (counts.reduce((p, c) => p + c, 0) !== count) { + const intersection = counts.reduce((p, c) => p + c, 0) - count; + let maxCountIndex = 0, maxCount = 0; + counts.forEach((c, i) => { + if (c > maxCount) { + maxCount = c; + maxCountIndex = i; + } + }); + counts[maxCountIndex] + intersection; + } + return counts + .map((count, i) => { + return splitLineEvenly(this.localToCanvasPoint(this.datas.points[i]), this.localToCanvasPoint(this.datas.points[i + 1]), count); + }) + .flat(); + } + else { + return splitLineEvenly(this.localToCanvasPoint(this.datas.points[0]), this.localToCanvasPoint(this.datas.points[this.datas.points.length - 1]), count); + } + } + buildRelation() { + this.relationManage.deleteRelationOfGraphicAndOtherType(this, Section.Type); + if (this.datas.sectionType === SectionType.Physical) { + this.queryStore.queryByType(Section.Type).forEach((section) => { + if (section.id === this.id) + return; + let param = []; + if (distance2(this.localToCanvasPoint(this.getStartPoint()), section.localToCanvasPoint(section.getStartPoint())) <= tolerance) { + param = [DevicePort.A, DevicePort.A]; + } + if (distance2(this.localToCanvasPoint(this.getEndPoint()), section.localToCanvasPoint(section.getStartPoint())) <= tolerance) { + param = [DevicePort.B, DevicePort.A]; + } + if (distance2(this.localToCanvasPoint(this.getStartPoint()), section.localToCanvasPoint(section.getEndPoint())) <= tolerance) { + param = [DevicePort.A, DevicePort.B]; + } + if (distance2(this.localToCanvasPoint(this.getEndPoint()), section.localToCanvasPoint(section.getEndPoint())) <= tolerance) { + param = [DevicePort.B, DevicePort.B]; + } + if (param.length) { + this.relationManage.addRelation(new GraphicRelationParam(this, param[0]), new GraphicRelationParam(section, param[1])); + } + }); + } + } + saveRelations() { + const paRelation = this.relationManage + .getRelationsOfGraphic(this) + .find((relation) => relation.getRelationParam(this).param === DevicePort.A && + (relation.getOtherGraphic(this) instanceof Section || + relation.getOtherGraphic(this) instanceof Turnout)); + const paDevice = paRelation?.getOtherGraphic(this); + if (paDevice) { + this.datas.paRef = IRelatedRef.create(paDevice.type, paDevice.id, paRelation.getOtherRelationParam(this).getParam()); + } + else { + this.datas.paRef = undefined; + } + const pbRelation = this.relationManage + .getRelationsOfGraphic(this) + .find((relation) => relation.getRelationParam(this).param === DevicePort.B && + (relation.getOtherGraphic(this) instanceof Section || + relation.getOtherGraphic(this) instanceof Turnout)); + const pbDevice = pbRelation?.getOtherGraphic(this); + if (pbDevice) { + this.datas.pbRef = IRelatedRef.create(pbDevice.type, pbDevice.id, pbRelation?.getOtherRelationParam(this).param); + } + else { + this.datas.pbRef = undefined; + } + this.datas.axleCountings = this.relationManage + .getRelationsOfGraphicAndOtherType(this, AxleCounting.Type) + .map((relation) => relation.getOtherGraphic(this).datas.id); + } + loadRelations() { + if (this.datas?.paRef?.id) { + this.relationManage.addRelation(new GraphicRelationParam(this, DevicePort.A), new GraphicRelationParam(this.queryStore.queryById(this.datas.paRef.id), DevicePort[this.datas.paRef.devicePort])); + } + if (this.datas?.pbRef?.id) { + this.relationManage.addRelation(new GraphicRelationParam(this, DevicePort.B), new GraphicRelationParam(this.queryStore.queryById(this.datas.pbRef.id), DevicePort[this.datas.pbRef.devicePort])); + } + if (this.datas.trackSectionId) { + this.relationManage.addRelation(this, this.queryStore.queryById(this.datas.trackSectionId)); + } + if (this.datas.sectionType === SectionType.TurnoutPhysical) { + if (this.datas.axleCountings) { + this.datas.axleCountings.forEach((id) => { + this.relationManage.addRelation(this, this.queryStore.queryById(id)); + }); + } + } + } +}; +class SectionTemplate extends JlGraphicTemplate { + constructor(dataTemplate, stateTemplate) { + super(Section$1.Type, { + dataTemplate, + stateTemplate, + }); + } + new() { + const section = new Section$1(); + section.loadData(this.datas); + section.loadState(this.states); + return section; + } +} + +export { Section$1 as Section, SectionTemplate, SectionType }; diff --git a/components/Section/SectionGraphic.js b/components/packages/Section/common/SectionGraphic.js similarity index 100% rename from components/Section/SectionGraphic.js rename to components/packages/Section/common/SectionGraphic.js diff --git a/components/Separator/Separator.js b/components/packages/Separator/Separator.js similarity index 100% rename from components/Separator/Separator.js rename to components/packages/Separator/Separator.js diff --git a/components/Separator/SeparatorConfig.js b/components/packages/Separator/SeparatorConfig.js similarity index 100% rename from components/Separator/SeparatorConfig.js rename to components/packages/Separator/SeparatorConfig.js diff --git a/components/Separator/SeparatorDrawAssistant.js b/components/packages/Separator/SeparatorDrawAssistant.js similarity index 100% rename from components/Separator/SeparatorDrawAssistant.js rename to components/packages/Separator/SeparatorDrawAssistant.js diff --git a/components/Signal/bjRtss/LampMainBody.js b/components/packages/Signal/bjRtss/LampMainBody.js similarity index 100% rename from components/Signal/bjRtss/LampMainBody.js rename to components/packages/Signal/bjRtss/LampMainBody.js diff --git a/components/Signal/bjRtss/Signal.js b/components/packages/Signal/bjRtss/Signal.js similarity index 100% rename from components/Signal/bjRtss/Signal.js rename to components/packages/Signal/bjRtss/Signal.js diff --git a/components/Signal/bjRtss/SignalDrawAssistant.js b/components/packages/Signal/bjRtss/SignalDrawAssistant.js similarity index 100% rename from components/Signal/bjRtss/SignalDrawAssistant.js rename to components/packages/Signal/bjRtss/SignalDrawAssistant.js diff --git a/components/Signal/common/CommonGraphics.js b/components/packages/Signal/common/CommonGraphics.js similarity index 100% rename from components/Signal/common/CommonGraphics.js rename to components/packages/Signal/common/CommonGraphics.js diff --git a/components/Signal/common/Lamp.js b/components/packages/Signal/common/Lamp.js similarity index 100% rename from components/Signal/common/Lamp.js rename to components/packages/Signal/common/Lamp.js diff --git a/components/Signal/common/SignalCode.js b/components/packages/Signal/common/SignalCode.js similarity index 100% rename from components/Signal/common/SignalCode.js rename to components/packages/Signal/common/SignalCode.js diff --git a/components/Signal/th/LampMainBody.js b/components/packages/Signal/th/LampMainBody.js similarity index 100% rename from components/Signal/th/LampMainBody.js rename to components/packages/Signal/th/LampMainBody.js diff --git a/components/Signal/th/Signal.js b/components/packages/Signal/th/Signal.js similarity index 100% rename from components/Signal/th/Signal.js rename to components/packages/Signal/th/Signal.js diff --git a/components/SpksSwitch/SpksSwitch.js b/components/packages/SpksSwitch/SpksSwitch.js similarity index 100% rename from components/SpksSwitch/SpksSwitch.js rename to components/packages/SpksSwitch/SpksSwitch.js diff --git a/components/Station/BeiJingStation.js b/components/packages/Station/BeiJingStation.js similarity index 100% rename from components/Station/BeiJingStation.js rename to components/packages/Station/BeiJingStation.js diff --git a/components/Station/JlStation.js b/components/packages/Station/JlStation.js similarity index 100% rename from components/Station/JlStation.js rename to components/packages/Station/JlStation.js diff --git a/components/packages/Station/StationConfig.d.ts b/components/packages/Station/StationConfig.d.ts index 01c7a0b..ac61b20 100644 --- a/components/packages/Station/StationConfig.d.ts +++ b/components/packages/Station/StationConfig.d.ts @@ -94,3 +94,15 @@ export interface IStationData extends GraphicData { copyFrom(data: IStationData): void; eq(other: IStationData): boolean; } +export interface KilometerSystem { + get coordinateSystem(): string; + set coordinateSystem(v: string); + get kilometer(): number; + set kilometer(v: number); + get direction(): Direction; + set direction(v: Direction); +} +export declare enum Direction { + LEFT = 0, + RIGHT = 1 +} diff --git a/components/Station/StationConfig.js b/components/packages/Station/StationConfig.js similarity index 100% rename from components/Station/StationConfig.js rename to components/packages/Station/StationConfig.js diff --git a/components/Station/StationDrawAssistant.js b/components/packages/Station/StationDrawAssistant.js similarity index 100% rename from components/Station/StationDrawAssistant.js rename to components/packages/Station/StationDrawAssistant.js diff --git a/components/Station/StationTemplate.js b/components/packages/Station/StationTemplate.js similarity index 100% rename from components/Station/StationTemplate.js rename to components/packages/Station/StationTemplate.js diff --git a/components/Station/XiAnStation.js b/components/packages/Station/XiAnStation.js similarity index 100% rename from components/Station/XiAnStation.js rename to components/packages/Station/XiAnStation.js diff --git a/components/Train/Train.js b/components/packages/Train/Train.js similarity index 100% rename from components/Train/Train.js rename to components/packages/Train/Train.js diff --git a/components/Train/TrainConfig.js b/components/packages/Train/TrainConfig.js similarity index 100% rename from components/Train/TrainConfig.js rename to components/packages/Train/TrainConfig.js diff --git a/components/Transponder/Transponder.js b/components/packages/Transponder/Transponder.js similarity index 100% rename from components/Transponder/Transponder.js rename to components/packages/Transponder/Transponder.js diff --git a/components/Transponder/TransponderConfig.js b/components/packages/Transponder/TransponderConfig.js similarity index 100% rename from components/Transponder/TransponderConfig.js rename to components/packages/Transponder/TransponderConfig.js diff --git a/components/Transponder/TransponderDrawAssistant.js b/components/packages/Transponder/TransponderDrawAssistant.js similarity index 100% rename from components/Transponder/TransponderDrawAssistant.js rename to components/packages/Transponder/TransponderDrawAssistant.js diff --git a/components/Turnout/Turnout.js b/components/packages/Turnout/Turnout.js similarity index 100% rename from components/Turnout/Turnout.js rename to components/packages/Turnout/Turnout.js diff --git a/rollup.config.cjs b/rollup.config.cjs index 6d81e18..11f0858 100644 --- a/rollup.config.cjs +++ b/rollup.config.cjs @@ -7,7 +7,7 @@ const typescript = require('@rollup/plugin-typescript'); */ const config = { external: ['jl-graphic'], - input: getEntryPoints('src/packages', 'src/packages'), + input: getEntryPoints('src/packages', 'src'), output: { dir: 'components', format: 'esm',