测试站台

This commit is contained in:
joylink_zhaoerwei 2024-01-03 09:30:56 +08:00
parent 50f8614df2
commit 023058ebb0
9 changed files with 26 additions and 28 deletions

View File

@ -1,11 +1,10 @@
import { GraphicState } from 'jl-graphic'; import { GraphicState } from 'jl-graphic';
import { CategoryType } from './PlatformConfig';
import { JlPlatform } from './JlPlatform'; import { JlPlatform } from './JlPlatform';
export interface IBeiJingPlatformState extends GraphicState { export interface IBeiJingPlatformState extends GraphicState {
id?: number; id?: number;
} }
export declare class BeiJingPlatform extends JlPlatform { export declare class BeiJingPlatform extends JlPlatform {
constructor(categoryType: CategoryType); constructor();
get states(): IBeiJingPlatformState; get states(): IBeiJingPlatformState;
doRepaint(): void; doRepaint(): void;
} }

View File

@ -1,9 +1,9 @@
import { BeiJingConsts } from './PlatformConfig.js'; import { CategoryType, BeiJingConsts } from './PlatformConfig.js';
import { JlPlatform } from './JlPlatform.js'; import { JlPlatform } from './JlPlatform.js';
class BeiJingPlatform extends JlPlatform { class BeiJingPlatform extends JlPlatform {
constructor(categoryType) { constructor() {
super(categoryType); super(CategoryType.BeiJing);
} }
get states() { get states() {
return this.getStates(); return this.getStates();

View File

@ -1,8 +1,8 @@
import { JlGraphicTemplate } from "jl-graphic"; import { JlGraphicTemplate } from 'jl-graphic';
import { JlPlatform } from "./JlPlatform"; import { JlPlatform } from './JlPlatform';
import { CategoryType, IPlatformData } from "./PlatformConfig"; import { CategoryType, IPlatformData } from './PlatformConfig';
import { IXiAnPlatformState } from "./XiAnPlatform"; import { IXiAnPlatformState } from './XiAnPlatform';
import { IBeiJingPlatformState } from "./BeiJingPlatform"; import { IBeiJingPlatformState } from './BeiJingPlatform';
export declare class PlatformTemplate extends JlGraphicTemplate<JlPlatform> { export declare class PlatformTemplate extends JlGraphicTemplate<JlPlatform> {
hasdoor?: boolean; hasdoor?: boolean;
direction?: string; direction?: string;

View File

@ -21,12 +21,12 @@ class PlatformTemplate extends JlGraphicTemplate {
new() { new() {
switch (this.categoryType) { switch (this.categoryType) {
case CategoryType.BeiJing: case CategoryType.BeiJing:
const BeiJing = new BeiJingPlatform(CategoryType.BeiJing); const BeiJing = new BeiJingPlatform();
BeiJing.loadData(this.datas); BeiJing.loadData(this.datas);
BeiJing.loadState(this.states); BeiJing.loadState(this.states);
return BeiJing; return BeiJing;
default: default:
const XiAn = new XiAnPlatform(CategoryType.XiAn); const XiAn = new XiAnPlatform();
XiAn.loadData(this.datas); XiAn.loadData(this.datas);
XiAn.loadState(this.states); XiAn.loadState(this.states);
return XiAn; return XiAn;

View File

@ -1,5 +1,4 @@
import { GraphicState } from 'jl-graphic'; import { GraphicState } from 'jl-graphic';
import { CategoryType } from './PlatformConfig';
import { JlPlatform } from './JlPlatform'; import { JlPlatform } from './JlPlatform';
export interface IXiAnPlatformState extends GraphicState { export interface IXiAnPlatformState extends GraphicState {
get emergstop(): boolean; get emergstop(): boolean;
@ -38,7 +37,7 @@ export interface IXiAnPlatformState extends GraphicState {
set rtuId(v: number); set rtuId(v: number);
} }
export declare class XiAnPlatform extends JlPlatform { export declare class XiAnPlatform extends JlPlatform {
constructor(categoryType: CategoryType); constructor();
get states(): IXiAnPlatformState; get states(): IXiAnPlatformState;
doRepaint(): void; doRepaint(): void;
} }

View File

@ -1,9 +1,9 @@
import { XiAnConsts } from './PlatformConfig.js'; import { CategoryType, XiAnConsts } from './PlatformConfig.js';
import { JlPlatform } from './JlPlatform.js'; import { JlPlatform } from './JlPlatform.js';
class XiAnPlatform extends JlPlatform { class XiAnPlatform extends JlPlatform {
constructor(categoryType) { constructor() {
super(categoryType); super(CategoryType.XiAn);
} }
get states() { get states() {
return this.getStates(); return this.getStates();

View File

@ -7,8 +7,8 @@ export interface IBeiJingPlatformState extends GraphicState {
} }
export class BeiJingPlatform extends JlPlatform { export class BeiJingPlatform extends JlPlatform {
constructor(categoryType: CategoryType) { constructor() {
super(categoryType); super(CategoryType.BeiJing);
} }
get states(): IBeiJingPlatformState { get states(): IBeiJingPlatformState {
return this.getStates<IBeiJingPlatformState>(); return this.getStates<IBeiJingPlatformState>();

View File

@ -1,8 +1,8 @@
import { JlGraphicTemplate } from "jl-graphic"; import { JlGraphicTemplate } from 'jl-graphic';
import { JlPlatform } from "./JlPlatform"; import { JlPlatform } from './JlPlatform';
import { CategoryType, IPlatformData } from "./PlatformConfig"; import { CategoryType, IPlatformData } from './PlatformConfig';
import { IXiAnPlatformState, XiAnPlatform } from "./XiAnPlatform"; import { IXiAnPlatformState, XiAnPlatform } from './XiAnPlatform';
import { BeiJingPlatform, IBeiJingPlatformState } from "./BeiJingPlatform"; import { BeiJingPlatform, IBeiJingPlatformState } from './BeiJingPlatform';
export class PlatformTemplate extends JlGraphicTemplate<JlPlatform> { export class PlatformTemplate extends JlGraphicTemplate<JlPlatform> {
hasdoor?: boolean; hasdoor?: boolean;
@ -25,12 +25,12 @@ export class PlatformTemplate extends JlGraphicTemplate<JlPlatform> {
new(): JlPlatform { new(): JlPlatform {
switch (this.categoryType) { switch (this.categoryType) {
case CategoryType.BeiJing: case CategoryType.BeiJing:
const BeiJing = new BeiJingPlatform(CategoryType.BeiJing); const BeiJing = new BeiJingPlatform();
BeiJing.loadData(this.datas); BeiJing.loadData(this.datas);
BeiJing.loadState(this.states); BeiJing.loadState(this.states);
return BeiJing; return BeiJing;
default: default:
const XiAn = new XiAnPlatform(CategoryType.XiAn); const XiAn = new XiAnPlatform();
XiAn.loadData(this.datas); XiAn.loadData(this.datas);
XiAn.loadState(this.states); XiAn.loadState(this.states);
return XiAn; return XiAn;

View File

@ -40,8 +40,8 @@ export interface IXiAnPlatformState extends GraphicState {
} }
export class XiAnPlatform extends JlPlatform { export class XiAnPlatform extends JlPlatform {
constructor(categoryType: CategoryType) { constructor() {
super(categoryType); super(CategoryType.XiAn);
} }
get states(): IXiAnPlatformState { get states(): IXiAnPlatformState {
return this.getStates<IXiAnPlatformState>(); return this.getStates<IXiAnPlatformState>();