rt-graphic-component/components/Signal/th/Signal.d.ts

113 lines
3.4 KiB
TypeScript
Raw Normal View History

2024-01-02 14:36:10 +08:00
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;