打包目录结构

This commit is contained in:
Yuan 2024-01-04 10:42:05 +08:00
parent 352025daf8
commit 3d104163f6
75 changed files with 277 additions and 1250 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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 {};

View File

@ -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<CategoryType, PlatformConstsConfig>;
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 {};

View File

@ -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<PlatformTemplate, IPlatformData> {
platformGraphic: JlPlatform;
constructor(app: IDrawApp, template: PlatformTemplate, icon: string);
bind(): void;
onLeftDown(e: FederatedPointerEvent): void;
redraw(p: Point): void;
prepareData(data: IPlatformData): boolean;
}

View File

@ -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<JlPlatform> {
hasdoor?: boolean;
direction?: string;
categoryType: CategoryType;
constructor(dataTemplate: IPlatformData, stateTemplate: IXiAnPlatformState | IBeiJingPlatformState, categoryType: CategoryType);
new(): JlPlatform;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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 };

View File

@ -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;
}

View File

@ -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<Separator> {
constructor(dataTemplate: ISeparatorData);
new(data?: UpdateSeparatorConsts): Separator;
}

View File

@ -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<ISeparatorConsts>;
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;

View File

@ -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<SeparatorTemplate, ISeparatorData> {
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<Separator> {
static Name: string;
constructor(app: IDrawApp);
static init(app: IDrawApp): SeparatorInteraction;
filter(...grahpics: JlGraphic[]): Separator[] | undefined;
bind(g: Separator): void;
unbind(g: Separator): void;
}

View File

@ -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;
}

View File

@ -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<Signal> {
constructor(dataTemplate: ISignalData, stateTemplate: ISignalState);
new(): Signal;
}

View File

@ -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<SignalTemplate, ISignalData> {
_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<Signal> {
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;
}

View File

@ -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;

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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 {};

View File

@ -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<CategoryType, StationConstsConfig>;
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
}

View File

@ -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<StationTemplate, IStationData> {
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<JlStation> {
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;
}

View File

@ -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<JlStation> {
hasControl?: boolean;
categoryType: CategoryType;
constructor(dataTemplate: IStationData, stateTemplate: IXiAnStationState | IBeiJingStationState, categoryType: CategoryType);
new(): JlStation;
}

View File

@ -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;
}

View File

@ -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<EnumStatusText, StatusText>;
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<Train> {
constructor(stateTemplate: any);
new(data?: UpdateTrainConsts): Train;
}
export {};

View File

@ -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<ITrainConstsConfig>;
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;

View File

@ -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<Transponder> {
constructor(dataTemplate: ITransponderData);
new(data?: UpdateTransponderConsts): Transponder;
}

View File

@ -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<ITransponderConsts>;
export declare function getTransponderConsts(): {
height: number;
lineWidth: number;
lineColor: string;
wblineColor: string;
textFontSize: number;
textMarginY: number;
vblineColor: string;
iblineColor: string;
};

View File

@ -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<TransponderTemplate, ITransponderData> {
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<Transponder> {
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;
}

View File

@ -1,4 +0,0 @@
import { JlGraphic } from "jl-graphic";
export declare class Turnout extends JlGraphic {
doRepaint(): void;
}

View File

@ -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 };

View File

@ -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 };

View File

@ -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 };

View File

@ -94,3 +94,15 @@ export interface IStationData extends GraphicData {
copyFrom(data: IStationData): void; copyFrom(data: IStationData): void;
eq(other: IStationData): boolean; 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
}

View File

@ -7,7 +7,7 @@ const typescript = require('@rollup/plugin-typescript');
*/ */
const config = { const config = {
external: ['jl-graphic'], external: ['jl-graphic'],
input: getEntryPoints('src/packages', 'src/packages'), input: getEntryPoints('src/packages', 'src'),
output: { output: {
dir: 'components', dir: 'components',
format: 'esm', format: 'esm',