代码调整
This commit is contained in:
parent
a354c9f136
commit
09437d5fa0
@ -62,13 +62,15 @@ class Separator extends JlGraphic {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
class SeparatorTemplate extends JlGraphicTemplate {
|
class SeparatorTemplate extends JlGraphicTemplate {
|
||||||
constructor(dataTemplate) {
|
updataConsts;
|
||||||
|
constructor(dataTemplate, data) {
|
||||||
super(Separator.Type, {
|
super(Separator.Type, {
|
||||||
dataTemplate,
|
dataTemplate,
|
||||||
});
|
});
|
||||||
|
this.updataConsts = data;
|
||||||
}
|
}
|
||||||
new(data) {
|
new() {
|
||||||
const separator = new Separator(data);
|
const separator = new Separator(this.updataConsts);
|
||||||
separator.loadData(this.datas);
|
separator.loadData(this.datas);
|
||||||
return separator;
|
return separator;
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ function getSeparatorConsts() {
|
|||||||
const separatorConsts = {
|
const separatorConsts = {
|
||||||
height: 12,
|
height: 12,
|
||||||
lineWidth: 2,
|
lineWidth: 2,
|
||||||
lineColor: '0x617799',
|
lineColor: '0xFFFFFF',
|
||||||
circleColor: '0xEF0200',
|
circleColor: '0xEF0200',
|
||||||
radius: 5,
|
radius: 5,
|
||||||
};
|
};
|
||||||
|
@ -4,9 +4,9 @@ import { Separator } from './Separator.js';
|
|||||||
|
|
||||||
class SeparatorDraw extends GraphicDrawAssistant {
|
class SeparatorDraw extends GraphicDrawAssistant {
|
||||||
SeparatorGraph;
|
SeparatorGraph;
|
||||||
constructor(app, template, data) {
|
constructor(app, template) {
|
||||||
super(app, template, 'sym_o_square', '分隔符Separator');
|
super(app, template, 'sym_o_square', '分隔符Separator');
|
||||||
this.SeparatorGraph = this.graphicTemplate.new(data);
|
this.SeparatorGraph = this.graphicTemplate.new();
|
||||||
this.container.addChild(this.SeparatorGraph);
|
this.container.addChild(this.SeparatorGraph);
|
||||||
SeparatorInteraction.init(app);
|
SeparatorInteraction.init(app);
|
||||||
}
|
}
|
||||||
|
@ -310,11 +310,13 @@ class Train extends JlGraphic {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
class TrainTemplate extends JlGraphicTemplate {
|
class TrainTemplate extends JlGraphicTemplate {
|
||||||
constructor(stateTemplate) {
|
updataConsts;
|
||||||
|
constructor(stateTemplate, data) {
|
||||||
super(Train.Type, { stateTemplate });
|
super(Train.Type, { stateTemplate });
|
||||||
|
this.updataConsts = data;
|
||||||
}
|
}
|
||||||
new(data) {
|
new() {
|
||||||
const train = new Train(data);
|
const train = new Train(this.updataConsts);
|
||||||
train.id = GraphicIdGenerator.next();
|
train.id = GraphicIdGenerator.next();
|
||||||
train.loadState(this.states);
|
train.loadState(this.states);
|
||||||
return train;
|
return train;
|
||||||
|
@ -32,12 +32,12 @@ function getTrainConsts() {
|
|||||||
borderWidth: 1,
|
borderWidth: 1,
|
||||||
codeFontSize: 22,
|
codeFontSize: 22,
|
||||||
textFontSize: 16, // 状态字母大小
|
textFontSize: 16, // 状态字母大小
|
||||||
textMarginY: 10, // 状态字母与列车距离
|
textMarginY: 5, // 状态字母与列车距离
|
||||||
statusTextList: [EnumStatusText.H, EnumStatusText.S, EnumStatusText.D, EnumStatusText.A],
|
statusTextList: [EnumStatusText.H, EnumStatusText.S, EnumStatusText.D, EnumStatusText.A],
|
||||||
marginX: 4, // 图形x轴边距
|
marginX: 2, // 图形x轴边距
|
||||||
pauseW: 4, // 停止框宽度
|
pauseW: 4, // 停止框宽度
|
||||||
codeColor: '0xffffff', // 车号颜色
|
codeColor: '0xffffff', // 车号颜色
|
||||||
borderColor: '0xA3E198', // 边框的颜色
|
borderColor: '0xffffff', // 边框的颜色
|
||||||
bodyBgColor: '0x737373', // body背景色
|
bodyBgColor: '0x737373', // body背景色
|
||||||
arrowDefaultColor: '0x00FF00', // 箭头默认颜色
|
arrowDefaultColor: '0x00FF00', // 箭头默认颜色
|
||||||
pauseDefaultColor: '0x00FF00', // 停止默认颜色
|
pauseDefaultColor: '0x00FF00', // 停止默认颜色
|
||||||
|
@ -85,13 +85,15 @@ class Transponder extends JlGraphic {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
class TransponderTemplate extends JlGraphicTemplate {
|
class TransponderTemplate extends JlGraphicTemplate {
|
||||||
constructor(dataTemplate) {
|
updataConsts;
|
||||||
|
constructor(dataTemplate, data) {
|
||||||
super(Transponder.Type, {
|
super(Transponder.Type, {
|
||||||
dataTemplate,
|
dataTemplate,
|
||||||
});
|
});
|
||||||
|
this.updataConsts = data;
|
||||||
}
|
}
|
||||||
new(data) {
|
new() {
|
||||||
const transponder = new Transponder(data);
|
const transponder = new Transponder(this.updataConsts);
|
||||||
transponder.loadData(this.datas);
|
transponder.loadData(this.datas);
|
||||||
return transponder;
|
return transponder;
|
||||||
}
|
}
|
||||||
|
@ -4,9 +4,9 @@ import { Transponder } from './Transponder.js';
|
|||||||
|
|
||||||
class TransponderDraw extends GraphicDrawAssistant {
|
class TransponderDraw extends GraphicDrawAssistant {
|
||||||
TransponderGraph;
|
TransponderGraph;
|
||||||
constructor(app, template, data) {
|
constructor(app, template) {
|
||||||
super(app, template, 'border_all', '应答器Transponder');
|
super(app, template, 'border_all', '应答器Transponder');
|
||||||
this.TransponderGraph = this.graphicTemplate.new(data);
|
this.TransponderGraph = this.graphicTemplate.new();
|
||||||
this.container.addChild(this.TransponderGraph);
|
this.container.addChild(this.TransponderGraph);
|
||||||
TransponderInteraction.init(app);
|
TransponderInteraction.init(app);
|
||||||
}
|
}
|
||||||
|
23
components/packages/Separator/Separator.d.ts
vendored
Normal file
23
components/packages/Separator/Separator.d.ts
vendored
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
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> {
|
||||||
|
updataConsts: UpdateSeparatorConsts | undefined;
|
||||||
|
constructor(dataTemplate: ISeparatorData, data?: UpdateSeparatorConsts);
|
||||||
|
new(): Separator;
|
||||||
|
}
|
25
components/packages/Separator/SeparatorConfig.d.ts
vendored
Normal file
25
components/packages/Separator/SeparatorConfig.d.ts
vendored
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
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;
|
25
components/packages/Separator/SeparatorDrawAssistant.d.ts
vendored
Normal file
25
components/packages/Separator/SeparatorDrawAssistant.d.ts
vendored
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
import { FederatedPointerEvent, IHitArea, Point } from 'pixi.js';
|
||||||
|
import { GraphicDrawAssistant, GraphicInteractionPlugin, IDrawApp, JlGraphic } from 'jl-graphic';
|
||||||
|
import { Separator, SeparatorTemplate } from './Separator';
|
||||||
|
import { ISeparatorData } from './SeparatorConfig';
|
||||||
|
export declare class SeparatorDraw extends GraphicDrawAssistant<SeparatorTemplate, ISeparatorData> {
|
||||||
|
SeparatorGraph: Separator;
|
||||||
|
constructor(app: IDrawApp, template: SeparatorTemplate);
|
||||||
|
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;
|
||||||
|
}
|
71
components/packages/Train/Train.d.ts
vendored
Normal file
71
components/packages/Train/Train.d.ts
vendored
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
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> {
|
||||||
|
updataConsts: UpdateTrainConsts | undefined;
|
||||||
|
constructor(stateTemplate: any, data?: UpdateTrainConsts);
|
||||||
|
new(): Train;
|
||||||
|
}
|
||||||
|
export {};
|
64
components/packages/Train/TrainConfig.d.ts
vendored
Normal file
64
components/packages/Train/TrainConfig.d.ts
vendored
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
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;
|
25
components/packages/Transponder/Transponder.d.ts
vendored
Normal file
25
components/packages/Transponder/Transponder.d.ts
vendored
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
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> {
|
||||||
|
updataConsts: UpdateTransponderConsts | undefined;
|
||||||
|
constructor(dataTemplate: ITransponderData, data?: UpdateTransponderConsts);
|
||||||
|
new(): Transponder;
|
||||||
|
}
|
43
components/packages/Transponder/TransponderConfig.d.ts
vendored
Normal file
43
components/packages/Transponder/TransponderConfig.d.ts
vendored
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
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;
|
||||||
|
};
|
22
components/packages/Transponder/TransponderDrawAssistant.d.ts
vendored
Normal file
22
components/packages/Transponder/TransponderDrawAssistant.d.ts
vendored
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import { FederatedPointerEvent, Point } from 'pixi.js';
|
||||||
|
import { GraphicDrawAssistant, GraphicInteractionPlugin, GraphicTransformEvent, IDrawApp, JlGraphic } from 'jl-graphic';
|
||||||
|
import { Transponder, TransponderTemplate } from './Transponder';
|
||||||
|
import { ITransponderData } from './TransponderConfig';
|
||||||
|
export declare class TransponderDraw extends GraphicDrawAssistant<TransponderTemplate, ITransponderData> {
|
||||||
|
TransponderGraph: Transponder;
|
||||||
|
constructor(app: IDrawApp, template: TransponderTemplate);
|
||||||
|
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;
|
||||||
|
}
|
@ -76,13 +76,15 @@ export class Separator extends JlGraphic {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class SeparatorTemplate extends JlGraphicTemplate<Separator> {
|
export class SeparatorTemplate extends JlGraphicTemplate<Separator> {
|
||||||
constructor(dataTemplate: ISeparatorData) {
|
updataConsts: UpdateSeparatorConsts | undefined;
|
||||||
|
constructor(dataTemplate: ISeparatorData, data?: UpdateSeparatorConsts) {
|
||||||
super(Separator.Type, {
|
super(Separator.Type, {
|
||||||
dataTemplate,
|
dataTemplate,
|
||||||
});
|
});
|
||||||
|
this.updataConsts = data
|
||||||
}
|
}
|
||||||
new(data?: UpdateSeparatorConsts): Separator {
|
new(): Separator {
|
||||||
const separator = new Separator(data);
|
const separator = new Separator(this.updataConsts);
|
||||||
separator.loadData(this.datas);
|
separator.loadData(this.datas);
|
||||||
return separator;
|
return separator;
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ export function getSeparatorConsts(): ISeparatorConsts {
|
|||||||
const separatorConsts = {
|
const separatorConsts = {
|
||||||
height: 12,
|
height: 12,
|
||||||
lineWidth: 2,
|
lineWidth: 2,
|
||||||
lineColor: '0x617799',
|
lineColor: '0xFFFFFF',
|
||||||
circleColor: '0xEF0200',
|
circleColor: '0xEF0200',
|
||||||
radius: 5,
|
radius: 5,
|
||||||
};
|
};
|
||||||
|
@ -16,9 +16,9 @@ export class SeparatorDraw extends GraphicDrawAssistant<
|
|||||||
ISeparatorData
|
ISeparatorData
|
||||||
> {
|
> {
|
||||||
SeparatorGraph: Separator;
|
SeparatorGraph: Separator;
|
||||||
constructor(app: IDrawApp, template: SeparatorTemplate, data?: UpdateSeparatorConsts) {
|
constructor(app: IDrawApp, template: SeparatorTemplate) {
|
||||||
super(app, template, 'sym_o_square', '分隔符Separator');
|
super(app, template, 'sym_o_square', '分隔符Separator');
|
||||||
this.SeparatorGraph = this.graphicTemplate.new(data);
|
this.SeparatorGraph = this.graphicTemplate.new();
|
||||||
this.container.addChild(this.SeparatorGraph);
|
this.container.addChild(this.SeparatorGraph);
|
||||||
SeparatorInteraction.init(app);
|
SeparatorInteraction.init(app);
|
||||||
}
|
}
|
||||||
|
@ -347,11 +347,13 @@ export class Train extends JlGraphic {
|
|||||||
|
|
||||||
|
|
||||||
export class TrainTemplate extends JlGraphicTemplate<Train> {
|
export class TrainTemplate extends JlGraphicTemplate<Train> {
|
||||||
constructor(stateTemplate: any) {
|
updataConsts: UpdateTrainConsts | undefined;
|
||||||
|
constructor(stateTemplate: any, data?: UpdateTrainConsts) {
|
||||||
super(Train.Type, { stateTemplate });
|
super(Train.Type, { stateTemplate });
|
||||||
|
this.updataConsts = data
|
||||||
}
|
}
|
||||||
new(data?: UpdateTrainConsts): Train {
|
new(): Train {
|
||||||
const train = new Train(data);
|
const train = new Train(this.updataConsts);
|
||||||
train.id = GraphicIdGenerator.next();
|
train.id = GraphicIdGenerator.next();
|
||||||
train.loadState(this.states);
|
train.loadState(this.states);
|
||||||
return train;
|
return train;
|
||||||
|
@ -78,12 +78,12 @@ export function getTrainConsts(): ITrainConstsConfig {
|
|||||||
borderWidth: 1,
|
borderWidth: 1,
|
||||||
codeFontSize: 22,
|
codeFontSize: 22,
|
||||||
textFontSize: 16, // 状态字母大小
|
textFontSize: 16, // 状态字母大小
|
||||||
textMarginY: 10, // 状态字母与列车距离
|
textMarginY: 5, // 状态字母与列车距离
|
||||||
statusTextList: [EnumStatusText.H, EnumStatusText.S, EnumStatusText.D, EnumStatusText.A],
|
statusTextList: [EnumStatusText.H, EnumStatusText.S, EnumStatusText.D, EnumStatusText.A],
|
||||||
marginX: 4, // 图形x轴边距
|
marginX: 2, // 图形x轴边距
|
||||||
pauseW: 4, // 停止框宽度
|
pauseW: 4, // 停止框宽度
|
||||||
codeColor: '0xffffff', // 车号颜色
|
codeColor: '0xffffff', // 车号颜色
|
||||||
borderColor: '0xA3E198', // 边框的颜色
|
borderColor: '0xffffff', // 边框的颜色
|
||||||
bodyBgColor: '0x737373', // body背景色
|
bodyBgColor: '0x737373', // body背景色
|
||||||
arrowDefaultColor: '0x00FF00', // 箭头默认颜色
|
arrowDefaultColor: '0x00FF00', // 箭头默认颜色
|
||||||
pauseDefaultColor: '0x00FF00', // 停止默认颜色
|
pauseDefaultColor: '0x00FF00', // 停止默认颜色
|
||||||
|
@ -96,13 +96,15 @@ export class Transponder extends JlGraphic {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class TransponderTemplate extends JlGraphicTemplate<Transponder> {
|
export class TransponderTemplate extends JlGraphicTemplate<Transponder> {
|
||||||
constructor(dataTemplate: ITransponderData) {
|
updataConsts: UpdateTransponderConsts | undefined;
|
||||||
|
constructor(dataTemplate: ITransponderData, data?: UpdateTransponderConsts) {
|
||||||
super(Transponder.Type, {
|
super(Transponder.Type, {
|
||||||
dataTemplate,
|
dataTemplate,
|
||||||
});
|
});
|
||||||
|
this.updataConsts = data
|
||||||
}
|
}
|
||||||
new(data?: UpdateTransponderConsts): Transponder {
|
new(): Transponder {
|
||||||
const transponder = new Transponder(data);
|
const transponder = new Transponder(this.updataConsts);
|
||||||
transponder.loadData(this.datas);
|
transponder.loadData(this.datas);
|
||||||
return transponder;
|
return transponder;
|
||||||
}
|
}
|
||||||
|
@ -19,9 +19,9 @@ export class TransponderDraw extends GraphicDrawAssistant<
|
|||||||
ITransponderData
|
ITransponderData
|
||||||
> {
|
> {
|
||||||
TransponderGraph: Transponder;
|
TransponderGraph: Transponder;
|
||||||
constructor(app: IDrawApp, template: TransponderTemplate, data?: UpdateTransponderConsts) {
|
constructor(app: IDrawApp, template: TransponderTemplate) {
|
||||||
super(app, template, 'border_all', '应答器Transponder');
|
super(app, template, 'border_all', '应答器Transponder');
|
||||||
this.TransponderGraph = this.graphicTemplate.new(data);
|
this.TransponderGraph = this.graphicTemplate.new();
|
||||||
this.container.addChild(this.TransponderGraph);
|
this.container.addChild(this.TransponderGraph);
|
||||||
TransponderInteraction.init(app);
|
TransponderInteraction.init(app);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user