rt-graphic-component/components/packages/Section/common/Section.d.ts

74 lines
2.3 KiB
TypeScript
Raw Normal View History

2024-01-04 10:40:55 +08:00
import { GraphicData, GraphicState, JlGraphic, JlGraphicTemplate, VectorText } from 'jl-graphic';
import { IPointData } from 'pixi.js';
import { SectionGraphic } from './SectionGraphic';
2024-01-04 15:14:25 +08:00
import { DevicePort, IRelatedRef } from 'common/common';
2024-01-04 10:40:55 +08:00
import { Turnout } from 'src/packages/Turnout/Turnout';
export interface ISectionData extends GraphicData {
code: string;
isCurve: boolean;
segmentsCount: number;
points: IPointData[];
sectionType: SectionType;
paRef?: IRelatedRef;
pbRef?: IRelatedRef;
axleCountings?: number[];
centralizedStations?: number[];
trackSectionId?: number;
clone(): ISectionData;
copyFrom(data: ISectionData): void;
eq(other: ISectionData): boolean;
}
export interface ISectionState extends GraphicState {
id: number;
occupied: boolean;
}
export declare enum SectionType {
Physical = 0,//物理区段
Logic = 1,//逻辑区段
TurnoutPhysical = 2,//道岔物理区段
Track = 4,//轨道区段
TrackLogic = 5
}
export interface SectionDisplayConfig {
lineColor: string;
occupiedColor: string;
lineWidth: number;
}
2024-01-09 14:11:27 +08:00
export declare const defaultDisplayConfig: SectionDisplayConfig;
2024-01-10 17:25:39 +08:00
export declare class JlSection extends JlGraphic {
2024-01-04 10:40:55 +08:00
static Type: string;
lineGraphic: SectionGraphic;
labelGraphic: VectorText;
displayConfig: SectionDisplayConfig;
constructor();
setDisplayConfig(config: SectionDisplayConfig): void;
getVerticesList(): IPointData[];
getStartPoint(): IPointData;
getEndPoint(): IPointData;
doRepaint(): void;
get datas(): ISectionData;
get states(): ISectionState;
get linePoints(): IPointData[];
set linePoints(points: IPointData[]);
getConnectElement(port: DevicePort): {
2024-01-10 17:25:39 +08:00
g: Turnout | JlSection;
2024-01-04 10:40:55 +08:00
port: DevicePort;
} | undefined;
/** 获取拆分逻辑区段数据 */
getSplitPoints(count: number): IPointData[][];
2024-01-10 15:46:15 +08:00
/**
* * Relation处理考虑按不同区段类型分别处理或交子类处理后导出子类
*
*
*/
2024-01-04 10:40:55 +08:00
buildRelation(): void;
saveRelations(): void;
loadRelations(): void;
}
2024-01-10 17:25:39 +08:00
export declare class SectionTemplate extends JlGraphicTemplate<JlSection> {
2024-01-09 14:11:27 +08:00
isCurve: boolean;
segmentsCount: number;
2024-01-04 10:40:55 +08:00
constructor(dataTemplate: ISectionData, stateTemplate?: ISectionState);
2024-01-10 17:25:39 +08:00
new(): JlSection;
2024-01-04 10:40:55 +08:00
}