站台微调

This commit is contained in:
joylink_zhaoerwei 2024-01-10 16:59:12 +08:00
parent 3c3a0a2ecb
commit a08ef74550
8 changed files with 8 additions and 35 deletions

View File

@ -1,7 +1,6 @@
import { JlGraphic, VectorText } from 'jl-graphic';
import { Container, Graphics } from 'pixi.js';
import { IPlatformData, PlatformConstsConfig } from './PlatformConfig';
import { StyleType } from 'common/common';
declare class RectGraphic extends Container {
rect: Graphics;
stateFillColor?: string;
@ -34,12 +33,11 @@ declare class LozengeGraphic extends Container {
clear(): void;
}
export declare class DoorCodeLozenge extends Container {
private styleType;
private platformConsts;
doorGraphic: DoorGraphic;
lozengeGraphic: LozengeGraphic;
codeGraphic: CodeGraphic;
constructor(styleType: StyleType);
constructor(platformConsts: PlatformConstsConfig);
draw(hasDoor: boolean, direction: string): void;
}
export declare abstract class JlPlatform extends JlGraphic {

View File

@ -1,6 +1,5 @@
import { calculateMirrorPoint, JlGraphic, getRectangleCenter, VectorText } from 'jl-graphic';
import { Container, Point, Graphics, Color, Rectangle } from 'pixi.js';
import { platformConstsMap } from './PlatformConfig.js';
//子元素--矩形
class RectGraphic extends Container {
@ -157,15 +156,13 @@ class LozengeGraphic extends Container {
}
}
class DoorCodeLozenge extends Container {
styleType;
platformConsts;
doorGraphic;
lozengeGraphic;
codeGraphic;
constructor(styleType) {
constructor(platformConsts) {
super();
this.styleType = styleType;
this.platformConsts = platformConstsMap.get(this.styleType);
this.platformConsts = platformConsts;
this.doorGraphic = new DoorGraphic();
this.addChild(this.doorGraphic);
this.lozengeGraphic = new LozengeGraphic();

View File

@ -1,4 +1,3 @@
import { StyleType } from 'common/common';
import { GraphicData } from 'jl-graphic';
export interface PlatformConstsConfig {
width: number;
@ -69,7 +68,6 @@ export declare const THConsts: {
doorPlatformSpacing: number;
};
};
export declare const platformConstsMap: Map<StyleType, PlatformConstsConfig>;
declare enum TypeOfPlatform {
Unknown = 0,
up = 1,

View File

@ -1,5 +1,3 @@
import { StyleType } from '../../common/common.js';
const GPConsts = {
width: 90,
height: 20,
@ -37,10 +35,6 @@ const THConsts = {
doorPlatformSpacing: 10,
},
};
const platformConstsMap = new Map([
[StyleType.GP, GPConsts],
[StyleType.TH, THConsts],
]);
var TypeOfPlatform;
(function (TypeOfPlatform) {
TypeOfPlatform[TypeOfPlatform["Unknown"] = 0] = "Unknown";
@ -48,4 +42,4 @@ var TypeOfPlatform;
TypeOfPlatform[TypeOfPlatform["down"] = 2] = "down";
})(TypeOfPlatform || (TypeOfPlatform = {}));
export { GPConsts, THConsts, platformConstsMap };
export { GPConsts, THConsts };

View File

@ -1,12 +1,11 @@
import { THConsts } from './PlatformConfig.js';
import { JlPlatform, DoorCodeLozenge } from './JlPlatform.js';
import { StyleType } from '../../common/common.js';
class THPlatform extends JlPlatform {
doorCodeLozenge;
constructor() {
super(THConsts);
this.doorCodeLozenge = new DoorCodeLozenge(StyleType.TH);
this.doorCodeLozenge = new DoorCodeLozenge(THConsts);
this.addChild(this.doorCodeLozenge);
}
get states() {

View File

@ -11,9 +11,7 @@ import {
IPlatformData,
LozengeConstsConfig,
PlatformConstsConfig,
platformConstsMap,
} from './PlatformConfig';
import { StyleType } from 'common/common';
//子元素--矩形
class RectGraphic extends Container {
@ -193,17 +191,13 @@ class LozengeGraphic extends Container {
}
export class DoorCodeLozenge extends Container {
private styleType: StyleType;
private platformConsts: PlatformConstsConfig;
doorGraphic: DoorGraphic;
lozengeGraphic: LozengeGraphic;
codeGraphic: CodeGraphic;
constructor(styleType: StyleType) {
constructor(platformConsts: PlatformConstsConfig) {
super();
this.styleType = styleType;
this.platformConsts = platformConstsMap.get(
this.styleType,
) as PlatformConstsConfig;
this.platformConsts = platformConsts;
this.doorGraphic = new DoorGraphic();
this.addChild(this.doorGraphic);
this.lozengeGraphic = new LozengeGraphic();

View File

@ -1,4 +1,3 @@
import { StyleType } from 'common/common';
import { GraphicData } from 'jl-graphic';
export interface PlatformConstsConfig {
@ -76,11 +75,6 @@ export const THConsts = {
},
};
export const platformConstsMap = new Map<StyleType, PlatformConstsConfig>([
[StyleType.GP, GPConsts],
[StyleType.TH, THConsts],
]);
enum TypeOfPlatform {
Unknown = 0,
up = 1,

View File

@ -1,7 +1,6 @@
import { GraphicState } from 'jl-graphic';
import { THConsts } from './PlatformConfig';
import { JlPlatform, DoorCodeLozenge } from './JlPlatform';
import { StyleType } from 'common/common';
export interface ITHPlatformState extends GraphicState {
get emergstop(): boolean; //紧急关闭
@ -44,7 +43,7 @@ export class THPlatform extends JlPlatform {
doorCodeLozenge: DoorCodeLozenge;
constructor() {
super(THConsts);
this.doorCodeLozenge = new DoorCodeLozenge(StyleType.TH);
this.doorCodeLozenge = new DoorCodeLozenge(THConsts);
this.addChild(this.doorCodeLozenge);
}
get states(): ITHPlatformState {