diff --git a/public/drawIcon.svg b/public/drawIcon.svg
index 45bb026..b214fc1 100644
--- a/public/drawIcon.svg
+++ b/public/drawIcon.svg
@@ -32,6 +32,11 @@
+
+
+
+
+
diff --git a/rts-sim-testing-message b/rts-sim-testing-message
index 6dff822..b748c7f 160000
--- a/rts-sim-testing-message
+++ b/rts-sim-testing-message
@@ -1 +1 @@
-Subproject commit 6dff8221d5e43e87727328fcd3260559ff13a2a3
+Subproject commit b748c7ff3ed7d401c8caeaecd3d4ec719ae27ee2
diff --git a/src/components/draw-app/DrawProperties.vue b/src/components/draw-app/DrawProperties.vue
index 810e384..dc9b47c 100644
--- a/src/components/draw-app/DrawProperties.vue
+++ b/src/components/draw-app/DrawProperties.vue
@@ -148,6 +148,9 @@
+
@@ -232,6 +235,8 @@ import GarageDoorProperty from './properties/GarageDoorProperty.vue';
import { GarageDoor } from 'src/graphics/garageDoor/GarageDoor';
import CarWashingProperty from './properties/CarWashingProperty.vue';
import { CarWashing } from 'src/graphics/carWashing/CarWashing';
+import GarageDoorBoxProperty from './properties/GarageDoorBoxProperty.vue';
+import { GarageDoorBox } from 'src/graphics/garageDoorBox/GarageDoorBox';
const drawStore = useDrawStore();
diff --git a/src/components/draw-app/properties/GarageDoorBoxProperty.vue b/src/components/draw-app/properties/GarageDoorBoxProperty.vue
new file mode 100644
index 0000000..e861091
--- /dev/null
+++ b/src/components/draw-app/properties/GarageDoorBoxProperty.vue
@@ -0,0 +1,78 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/src/drawApp/common.ts b/src/drawApp/common.ts
index 18dcc33..21bb5c9 100644
--- a/src/drawApp/common.ts
+++ b/src/drawApp/common.ts
@@ -24,6 +24,7 @@ import { PslBox } from 'src/graphics/pslBox/PslBox';
import { GarageDoor } from 'src/graphics/garageDoor/GarageDoor';
import { CarWashing } from 'src/graphics/carWashing/CarWashing';
import { FloodGate } from 'src/graphics/floodGate/FloodGate';
+import { GarageDoorBox } from 'src/graphics/garageDoorBox/GarageDoorBox';
export const drawCommonLayerList = [
// 图层列表 默认显示的图层defaultShow: true
@@ -61,4 +62,5 @@ export const drawCommonLayerList = [
{ label: '车库门', value: GarageDoor.Type, defaultShow: true },
{ label: '防淹门', value: FloodGate.Type, defaultShow: true },
{ label: '洗车机', value: CarWashing.Type, defaultShow: true },
+ { label: '车库门设置', value: GarageDoorBox.Type, defaultShow: true },
];
diff --git a/src/drawApp/commonApp.ts b/src/drawApp/commonApp.ts
index 5079ef6..5cc5549 100644
--- a/src/drawApp/commonApp.ts
+++ b/src/drawApp/commonApp.ts
@@ -96,6 +96,15 @@ import {
GatedBoxData,
DrawGatedBoxInteraction,
} from './graphics/GatedBoxInteraction';
+import {
+ GarageDoorBox,
+ GarageDoorBoxTemplate,
+} from 'src/graphics/garageDoorBox/GarageDoorBox';
+import {
+ GarageDoorBoxData,
+ DrawGarageDoorBoxInteraction,
+} from './graphics/GarageDoorBoxInteraction';
+import { GarageDoorBoxDraw } from 'src/graphics/garageDoorBox/GarageDoorBoxAssistant';
// import { EsbButton, EsbButtonTemplate } from 'src/graphics/esbButton/EsbButton';
// import {
// EsbButtonData,
@@ -223,6 +232,10 @@ export function initCommonDrawApp(app: IDrawApp) {
new StopPositionDraw(app, new StopPositionTemplate(new StopPositionData()));
new SpksSwitchDraw(app, new SpksSwitchTemplate(new SpksSwitchData()));
new GatedBoxDraw(app, new GatedBoxTemplate(new GatedBoxData()));
+ new GarageDoorBoxDraw(
+ app,
+ new GarageDoorBoxTemplate(new GarageDoorBoxData())
+ );
// new EsbButtonDraw(
// app,
// new EsbButtonTemplate(new EsbButtonData(), new EsbButtonState())
@@ -250,6 +263,7 @@ export function initCommonDrawApp(app: IDrawApp) {
DrawStopPositionInteraction.init(app);
DrawSpksSwitchInteraction.init(app);
DrawGatedBoxInteraction.init(app);
+ DrawGarageDoorBoxInteraction.init(app);
// DrawEsbButtonInteraction.init(app);
// 画布右键菜单
@@ -431,6 +445,9 @@ export function loadCommonDrawDatas(
storage.gateBoxs.forEach((gatedBox) => {
datas.push(new GatedBoxData(gatedBox));
});
+ storage.garageDoorBoxes.forEach((garageDoorBox) => {
+ datas.push(new GarageDoorBoxData(garageDoorBox));
+ });
// storage.esbButtons.forEach((esbButton) => {
// datas.push(new EsbButtonData(esbButton));
// });
@@ -523,6 +540,11 @@ export function saveCommonDrawDatas(app: IDrawApp) {
// } else if (EsbButton.Type === g.type) {
// const esbButtonData = (g as EsbButton).saveData();
// storage.esbButtons.push((esbButtonData as EsbButtonData).data);
+ } else if (GarageDoorBox.Type === g.type) {
+ const garageDoorBoxData = (g as GarageDoorBox).saveData();
+ storage.garageDoorBoxes.push(
+ (garageDoorBoxData as GarageDoorBoxData).data
+ );
} else if (Transponder.Type === g.type) {
const transponderData = (g as Transponder).saveData();
storage.transponders.push((transponderData as TransponderData).data);
diff --git a/src/drawApp/graphics/GarageDoorBoxInteraction.ts b/src/drawApp/graphics/GarageDoorBoxInteraction.ts
new file mode 100644
index 0000000..9c5860b
--- /dev/null
+++ b/src/drawApp/graphics/GarageDoorBoxInteraction.ts
@@ -0,0 +1,150 @@
+import * as pb_1 from 'google-protobuf';
+import { DisplayObject, FederatedMouseEvent } from 'pixi.js';
+import {
+ GarageDoorBox,
+ IGarageDoorBox,
+} from 'src/graphics/garageDoorBox/GarageDoorBox';
+import {
+ IGraphicApp,
+ GraphicInteractionPlugin,
+ JlGraphic,
+ IGraphicScene,
+ MenuItemOptions,
+ ContextMenu,
+} from 'jl-graphic';
+
+import { graphicData } from 'src/protos/stationLayoutGraphics';
+import { GraphicDataBase } from './GraphicDataBase';
+import { usePslStore } from 'src/stores/psl-store';
+
+export class GarageDoorBoxData
+ extends GraphicDataBase
+ implements IGarageDoorBox
+{
+ constructor(data?: graphicData.GarageDoorBox) {
+ let garageDoorBox;
+ if (!data) {
+ garageDoorBox = new graphicData.GarageDoorBox({
+ common: GraphicDataBase.defaultCommonInfo(GarageDoorBox.Type),
+ });
+ } else {
+ garageDoorBox = data;
+ }
+ super(garageDoorBox);
+ }
+
+ public get data(): graphicData.GarageDoorBox {
+ return this.getData();
+ }
+ get code(): string {
+ return this.data.code;
+ }
+ set code(v: string) {
+ this.data.code = v;
+ }
+ get flip(): boolean {
+ return this.data.flip;
+ }
+ set flip(v: boolean) {
+ this.data.flip = v;
+ }
+ get refGarageDoorId(): number {
+ return this.data.refGarageDoorId;
+ }
+ set refGarageDoorId(v: number) {
+ this.data.refGarageDoorId = v;
+ }
+ get refPslMapCode(): string {
+ return this.data.refPslMapCode;
+ }
+ set refPslMapCode(v: string) {
+ this.data.refPslMapCode = v;
+ }
+ clone(): GarageDoorBoxData {
+ return new GarageDoorBoxData(this.data.cloneMessage());
+ }
+ copyFrom(data: GarageDoorBoxData): void {
+ pb_1.Message.copyInto(data.data, this.data);
+ }
+ eq(other: GarageDoorBoxData): boolean {
+ return pb_1.Message.equals(this.data, other.data);
+ }
+}
+
+const flipConfig: MenuItemOptions = {
+ name: '上下翻转',
+};
+const GarageDoorBoxEditMenu: ContextMenu = ContextMenu.init({
+ name: '设置车库门编辑菜单',
+ groups: [
+ {
+ items: [flipConfig],
+ },
+ ],
+});
+export class DrawGarageDoorBoxInteraction extends GraphicInteractionPlugin {
+ static Name = 'garage_door_box_draw_right_menu';
+ constructor(app: IGraphicApp) {
+ super(DrawGarageDoorBoxInteraction.Name, app);
+ app.registerMenu(GarageDoorBoxEditMenu);
+ }
+ static init(app: IGraphicApp) {
+ return new DrawGarageDoorBoxInteraction(app);
+ }
+ filter(...grahpics: JlGraphic[]): GarageDoorBox[] | undefined {
+ return grahpics
+ .filter((g) => g.type === GarageDoorBox.Type)
+ .map((g) => g as GarageDoorBox);
+ }
+ bind(g: GarageDoorBox): void {
+ g.on('_rightclick', this.onContextMenu, this);
+ }
+
+ unbind(g: GarageDoorBox): void {
+ g.off('_rightclick', this.onContextMenu, this);
+ }
+
+ onContextMenu(e: FederatedMouseEvent) {
+ const target = e.target as DisplayObject;
+ const garageDoorBox = target.getGraphic() as GarageDoorBox;
+ this.app.updateSelected(garageDoorBox);
+ flipConfig.handler = () => {
+ garageDoorBox.datas.flip = !garageDoorBox.datas.flip;
+ garageDoorBox.repaint();
+ };
+ GarageDoorBoxEditMenu.open(e.global);
+ }
+}
+
+export class GarageDoorBoxOperateInteraction extends GraphicInteractionPlugin {
+ static Name = 'garage_door_box_operate_menu';
+ constructor(app: IGraphicScene) {
+ super(GarageDoorBoxOperateInteraction.Name, app);
+ }
+ static init(app: IGraphicScene) {
+ return new GarageDoorBoxOperateInteraction(app);
+ }
+ filter(...grahpics: JlGraphic[]): GarageDoorBox[] | undefined {
+ return grahpics
+ .filter((g) => g.type === GarageDoorBox.Type)
+ .map((g) => g as GarageDoorBox);
+ }
+ bind(g: GarageDoorBox): void {
+ g.eventMode = 'static';
+ g.cursor = 'pointer';
+ g.on('_leftclick', this.onLeftClick, this);
+ }
+
+ unbind(g: GarageDoorBox): void {
+ g.eventMode = 'none';
+ g.off('_leftclick', this.onLeftClick, this);
+ }
+ onLeftClick(e: FederatedMouseEvent) {
+ const target = e.target as DisplayObject;
+ const garageDoorBox = target.getGraphic() as GarageDoorBox;
+ usePslStore().setPslParam(
+ garageDoorBox.datas.id,
+ garageDoorBox.datas.refPslMapCode
+ );
+ }
+}
diff --git a/src/drawApp/lineScene.ts b/src/drawApp/lineScene.ts
index e1d4375..ced567e 100644
--- a/src/drawApp/lineScene.ts
+++ b/src/drawApp/lineScene.ts
@@ -128,6 +128,11 @@ import {
SpksSwitchOperationInteraction,
} from './graphics/SpksSwitchInteraction';
import { GatedBoxData } from './graphics/GatedBoxInteraction';
+import { GarageDoorBoxData } from './graphics/GarageDoorBoxInteraction';
+import {
+ GarageDoorBox,
+ GarageDoorBoxTemplate,
+} from 'src/graphics/garageDoorBox/GarageDoorBox';
import {
EsbButtonData,
EsbButtonOperationInteraction,
@@ -169,6 +174,7 @@ import {
} from 'src/graphics/trackLogicSection/TrackLogicSection';
import { TrackLogicSectionData } from './graphics/TrackLogicSectionInteraction';
import { GatedBoxOperateInteraction } from './graphics/GatedBoxInteraction';
+import { GarageDoorBoxOperateInteraction } from './graphics/GarageDoorBoxInteraction';
import { CategoryType } from 'src/components/CategoryType';
import {
AutoReturnBox,
@@ -257,6 +263,7 @@ export const layerList = [
{ label: '车库门', value: GarageDoor.Type, defaultShow: true },
{ label: '防淹门', value: FloodGate.Type, defaultShow: true },
{ label: '洗车机', value: CarWashing.Type, defaultShow: true },
+ { label: '车库门设置', value: GarageDoorBox.Type, defaultShow: true },
];
let lineScene: IGraphicScene;
@@ -328,6 +335,7 @@ export function initLineScene(lineApp: IGraphicApp, sceneName: string) {
new CarWashingTemplate(new CarWashingData()),
new GarageDoorTemplate(new GarageDoorData()),
new FloodGateTemplate(new FloodGateData()),
+ new GarageDoorBoxTemplate(new GarageDoorBoxData()),
];
lineScene.registerGraphicTemplates(...graphicTemplate);
SignalOperateInteraction.init(lineScene);
@@ -347,6 +355,7 @@ export function initLineScene(lineApp: IGraphicApp, sceneName: string) {
CarWashingOperationInteraction.init(lineScene);
GarageDoorOperationInteraction.init(lineScene);
FloodGateOperationInteraction.init(lineScene);
+ GarageDoorBoxOperateInteraction.init(lineScene);
if (categoryType === CategoryType.TH) {
GatedBoxOperateInteraction.init(lineScene);
}
@@ -651,6 +660,9 @@ export async function loadLineDatas(): Promise {
storage.floodGates.forEach((floodGate) => {
datas.push(new FloodGateData(floodGate));
});
+ storage.garageDoorBoxes.forEach((garageDoorBox) => {
+ datas.push(new GarageDoorBoxData(garageDoorBox));
+ });
// const linkIdGenerator = new IdGenerator(Link.Type);
// storage.CalculateLink.forEach((link) => {
// const g = new LinkData(link);
diff --git a/src/graphics/garageDoorBox/GarageDoorBox.ts b/src/graphics/garageDoorBox/GarageDoorBox.ts
new file mode 100644
index 0000000..162b2cf
--- /dev/null
+++ b/src/graphics/garageDoorBox/GarageDoorBox.ts
@@ -0,0 +1,110 @@
+import { Graphics } from 'pixi.js';
+import {
+ GraphicData,
+ JlGraphic,
+ JlGraphicTemplate,
+ VectorText,
+} from 'jl-graphic';
+
+export interface IGarageDoorBox extends GraphicData {
+ get code(): string;
+ set code(v: string);
+ get flip(): boolean;
+ set flip(v: boolean);
+ get refGarageDoorId(): number;
+ set refGarageDoorId(v: number);
+ get refPslMapCode(): string;
+ set refPslMapCode(v: string);
+ clone(): IGarageDoorBox;
+ copyFrom(data: IGarageDoorBox): void;
+ eq(other: IGarageDoorBox): boolean;
+}
+
+const garageDoorBoxConsts = {
+ codeFontSize: 12,
+ codeColor: 0xffffff,
+ bodyLineColor: 0xffffff,
+ bodyLineWidth: 4,
+ bodyRectLineColor: 0xffffff,
+ bodyRectLineWidth: 2,
+ bodyRectWidth: 20,
+ bodyRectHeight: 20,
+ bodyColor: 0x000000,
+};
+export class GarageDoorBox extends JlGraphic {
+ static Type = 'garageDoorBox';
+ codeGraph: VectorText = new VectorText('');
+ rectBody: Graphics = new Graphics();
+ lineBody: Graphics = new Graphics();
+ textGraph: VectorText = new VectorText('G');
+
+ constructor() {
+ super(GarageDoorBox.Type);
+ this.addChild(this.codeGraph);
+ this.addChild(this.rectBody);
+ this.addChild(this.lineBody);
+ this.addChild(this.textGraph);
+ this.codeGraph.name = 'g_d_b_code';
+ }
+ get code(): string {
+ return this.datas.code;
+ }
+ get datas(): IGarageDoorBox {
+ return this.getDatas();
+ }
+ doRepaint(): void {
+ const codeGraph = this.codeGraph;
+ codeGraph.text = this.datas.code;
+ codeGraph.style.fill = garageDoorBoxConsts.codeColor;
+ codeGraph.setVectorFontSize(garageDoorBoxConsts.codeFontSize);
+ const codeTransform = this.datas?.childTransforms?.find(
+ (item) => item.name === 'g_d_b_code'
+ );
+ if (codeTransform) {
+ const position = codeTransform?.transform.position;
+ const rotation = codeTransform?.transform?.rotation;
+ codeGraph.position.set(position?.x, position?.y);
+ codeGraph.rotation = rotation || 0;
+ } else {
+ codeGraph.position.set(20, 0);
+ }
+ codeGraph.anchor.set(0.5);
+ this.textGraph.style.fill = garageDoorBoxConsts.codeColor;
+ this.textGraph.setVectorFontSize(garageDoorBoxConsts.codeFontSize);
+ this.textGraph.anchor.set(0.5);
+ this.rectBody.clear();
+ this.rectBody.beginFill(garageDoorBoxConsts.bodyColor, 0);
+ this.rectBody.lineStyle(
+ garageDoorBoxConsts.bodyRectLineWidth,
+ garageDoorBoxConsts.bodyRectLineColor
+ );
+ this.rectBody.drawRect(
+ -garageDoorBoxConsts.bodyRectWidth / 2,
+ -garageDoorBoxConsts.bodyRectHeight / 2,
+ garageDoorBoxConsts.bodyRectWidth,
+ garageDoorBoxConsts.bodyRectHeight
+ );
+ this.rectBody.endFill();
+ this.lineBody.clear();
+ const lineY = this.datas.flip
+ ? garageDoorBoxConsts.bodyRectHeight / 2
+ : -garageDoorBoxConsts.bodyRectHeight / 2;
+ this.lineBody.lineStyle(
+ garageDoorBoxConsts.bodyLineWidth,
+ garageDoorBoxConsts.bodyLineColor
+ );
+ this.lineBody.moveTo(-garageDoorBoxConsts.bodyRectWidth / 2, lineY);
+ this.lineBody.lineTo(garageDoorBoxConsts.bodyRectWidth / 2, lineY);
+ }
+}
+
+export class GarageDoorBoxTemplate extends JlGraphicTemplate {
+ constructor(dataTemplate: IGarageDoorBox) {
+ super(GarageDoorBox.Type, { dataTemplate });
+ }
+ new(): GarageDoorBox {
+ const garageDoorBox = new GarageDoorBox();
+ garageDoorBox.loadData(this.datas);
+ return garageDoorBox;
+ }
+}
diff --git a/src/graphics/garageDoorBox/GarageDoorBoxAssistant.ts b/src/graphics/garageDoorBox/GarageDoorBoxAssistant.ts
new file mode 100644
index 0000000..c27f6e7
--- /dev/null
+++ b/src/graphics/garageDoorBox/GarageDoorBoxAssistant.ts
@@ -0,0 +1,132 @@
+import { DisplayObject, FederatedMouseEvent, Point } from 'pixi.js';
+import {
+ AbsorbableLine,
+ AbsorbablePosition,
+ GraphicDrawAssistant,
+ GraphicInteractionPlugin,
+ GraphicTransformEvent,
+ IDrawApp,
+ JlGraphic,
+} from 'jl-graphic';
+import {
+ GarageDoorBox,
+ GarageDoorBoxTemplate,
+ IGarageDoorBox,
+} from './GarageDoorBox';
+
+export interface IGarageDoorBoxDrawOptions {
+ newData: () => IGarageDoorBox;
+}
+export class GarageDoorBoxDraw extends GraphicDrawAssistant<
+ GarageDoorBoxTemplate,
+ IGarageDoorBox
+> {
+ _garageDoorBox: GarageDoorBox | null = null;
+ constructor(app: IDrawApp, template: GarageDoorBoxTemplate) {
+ super(
+ app,
+ template,
+ 'svguse:../../drawIcon.svg#icon-garage-door-box',
+ '设置车库门GarageDoorBox'
+ );
+ GarageDoorBoxInteraction.init(app);
+ }
+ public get garageDoorBox(): GarageDoorBox {
+ if (!this._garageDoorBox) {
+ this._garageDoorBox = this.graphicTemplate.new();
+ this._garageDoorBox.loadData(this.graphicTemplate.datas);
+ this.container.addChild(this._garageDoorBox);
+ }
+ return this._garageDoorBox;
+ }
+
+ onLeftUp(e: FederatedMouseEvent): void {
+ this.container.position.copyFrom(this.toCanvasCoordinates(e.global));
+ this.createAndStore(true);
+ }
+
+ redraw(p: Point): void {
+ this.garageDoorBox.repaint();
+ this.container.position.set(p.x, p.y);
+ }
+
+ prepareData(data: IGarageDoorBox): boolean {
+ data.transform = this.container.saveTransform();
+ data.code = 'G';
+ return true;
+ }
+}
+/**
+ * 构建吸附线
+ * @param garageDoorBox
+ */
+function buildAbsorbablePositions(
+ garageDoorBox: GarageDoorBox
+): AbsorbablePosition[] {
+ const aps: AbsorbablePosition[] = [];
+ const garageDoorBoxs = garageDoorBox.queryStore.queryByType(
+ GarageDoorBox.Type
+ );
+ const canvas = garageDoorBox.getCanvas();
+ garageDoorBoxs.forEach((item) => {
+ if (item.id === garageDoorBox.id) {
+ return;
+ }
+ const ala = new AbsorbableLine(
+ new Point(item.x, 0),
+ new Point(item.x, canvas.height)
+ );
+ const alb = new AbsorbableLine(
+ new Point(0, item.y),
+ new Point(canvas.width, item.y)
+ );
+ aps.push(ala);
+ aps.push(alb);
+ });
+ return aps;
+}
+
+export class GarageDoorBoxInteraction extends GraphicInteractionPlugin {
+ static Name = 'garage_door_box_transform';
+ constructor(app: IDrawApp) {
+ super(GarageDoorBoxInteraction.Name, app);
+ }
+ static init(app: IDrawApp) {
+ return new GarageDoorBoxInteraction(app);
+ }
+ filter(...grahpics: JlGraphic[]): GarageDoorBox[] | undefined {
+ return grahpics
+ .filter((g) => g.type === GarageDoorBox.Type)
+ .map((g) => g as GarageDoorBox);
+ }
+ bind(g: GarageDoorBox): void {
+ g.eventMode = 'static';
+ g.cursor = 'pointer';
+ g.scalable = true;
+ g.rotatable = true;
+ g.codeGraph.draggable = true;
+ g.codeGraph.selectable = true;
+ g.codeGraph.rotatable = true;
+ g.codeGraph.transformSave = true;
+ g.codeGraph.eventMode = 'static';
+ g.on('transformstart', this.transformstart, this);
+ }
+ unbind(g: GarageDoorBox): void {
+ g.eventMode = 'none';
+ g.scalable = false;
+ g.rotatable = false;
+ g.codeGraph.draggable = false;
+ g.codeGraph.selectable = false;
+ g.codeGraph.rotatable = false;
+ g.codeGraph.transformSave = false;
+ g.codeGraph.eventMode = 'none';
+ g.off('transformstart', this.transformstart, this);
+ }
+ transformstart(e: GraphicTransformEvent) {
+ const target = e.target as DisplayObject;
+ const garageDoorBox = target.getGraphic() as GarageDoorBox;
+ garageDoorBox.getGraphicApp().setOptions({
+ absorbablePositions: buildAbsorbablePositions(garageDoorBox),
+ });
+ }
+}
diff --git a/src/layouts/DrawLayout.vue b/src/layouts/DrawLayout.vue
index 07e6385..ed53f63 100644
--- a/src/layouts/DrawLayout.vue
+++ b/src/layouts/DrawLayout.vue
@@ -277,6 +277,7 @@ import { PslBox } from 'src/graphics/pslBox/PslBox';
import { CarWashing } from 'src/graphics/carWashing/CarWashing';
import { FloodGate } from 'src/graphics/floodGate/FloodGate';
import { GarageDoor } from 'src/graphics/garageDoor/GarageDoor';
+import { GarageDoorBox } from 'src/graphics/garageDoorBox/GarageDoorBox';
const $q = useQuasar();
const route = useRoute();
@@ -445,6 +446,7 @@ onMounted(() => {
CarWashing.Type,
FloodGate.Type,
GarageDoor.Type,
+ GarageDoorBox.Type,
];
switch (drawStore.categoryType) {
case CategoryType.TH:
diff --git a/src/protos/device_state.ts b/src/protos/device_state.ts
index 52ef9e6..1228222 100644
--- a/src/protos/device_state.ts
+++ b/src/protos/device_state.ts
@@ -1020,6 +1020,7 @@ export namespace state {
constructor(data?: any[] | {
conn?: boolean;
connType?: TrainConnState.TrainConnType;
+ TrainControlMapId?: number;
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
@@ -1030,6 +1031,9 @@ export namespace state {
if ("connType" in data && data.connType != undefined) {
this.connType = data.connType;
}
+ if ("TrainControlMapId" in data && data.TrainControlMapId != undefined) {
+ this.TrainControlMapId = data.TrainControlMapId;
+ }
}
}
get conn() {
@@ -1044,9 +1048,16 @@ export namespace state {
set connType(value: TrainConnState.TrainConnType) {
pb_1.Message.setField(this, 2, value);
}
+ get TrainControlMapId() {
+ return pb_1.Message.getFieldWithDefault(this, 3, 0) as number;
+ }
+ set TrainControlMapId(value: number) {
+ pb_1.Message.setField(this, 3, value);
+ }
static fromObject(data: {
conn?: boolean;
connType?: TrainConnState.TrainConnType;
+ TrainControlMapId?: number;
}): TrainConnState {
const message = new TrainConnState({});
if (data.conn != null) {
@@ -1055,12 +1066,16 @@ export namespace state {
if (data.connType != null) {
message.connType = data.connType;
}
+ if (data.TrainControlMapId != null) {
+ message.TrainControlMapId = data.TrainControlMapId;
+ }
return message;
}
toObject() {
const data: {
conn?: boolean;
connType?: TrainConnState.TrainConnType;
+ TrainControlMapId?: number;
} = {};
if (this.conn != null) {
data.conn = this.conn;
@@ -1068,6 +1083,9 @@ export namespace state {
if (this.connType != null) {
data.connType = this.connType;
}
+ if (this.TrainControlMapId != null) {
+ data.TrainControlMapId = this.TrainControlMapId;
+ }
return data;
}
serialize(): Uint8Array;
@@ -1078,6 +1096,8 @@ export namespace state {
writer.writeBool(1, this.conn);
if (this.connType != TrainConnState.TrainConnType.NONE)
writer.writeEnum(2, this.connType);
+ if (this.TrainControlMapId != 0)
+ writer.writeUint32(3, this.TrainControlMapId);
if (!w)
return writer.getResultBuffer();
}
@@ -1093,6 +1113,9 @@ export namespace state {
case 2:
message.connType = reader.readEnum();
break;
+ case 3:
+ message.TrainControlMapId = reader.readUint32();
+ break;
default: reader.skipField();
}
}
@@ -1138,6 +1161,7 @@ export namespace state {
tailOffset?: number;
tailDevicePort?: string;
btmState?: BTMState;
+ tcc?: TrainControlState;
connState?: TrainConnState;
}) {
super();
@@ -1212,6 +1236,9 @@ export namespace state {
if ("btmState" in data && data.btmState != undefined) {
this.btmState = data.btmState;
}
+ if ("tcc" in data && data.tcc != undefined) {
+ this.tcc = data.tcc;
+ }
if ("connState" in data && data.connState != undefined) {
this.connState = data.connState;
}
@@ -1373,15 +1400,24 @@ export namespace state {
get has_btmState() {
return pb_1.Message.getField(this, 23) != null;
}
- get connState() {
- return pb_1.Message.getWrapperField(this, TrainConnState, 24) as TrainConnState;
+ get tcc() {
+ return pb_1.Message.getWrapperField(this, TrainControlState, 24) as TrainControlState;
}
- set connState(value: TrainConnState) {
+ set tcc(value: TrainControlState) {
pb_1.Message.setWrapperField(this, 24, value);
}
- get has_connState() {
+ get has_tcc() {
return pb_1.Message.getField(this, 24) != null;
}
+ get connState() {
+ return pb_1.Message.getWrapperField(this, TrainConnState, 25) as TrainConnState;
+ }
+ set connState(value: TrainConnState) {
+ pb_1.Message.setWrapperField(this, 25, value);
+ }
+ get has_connState() {
+ return pb_1.Message.getField(this, 25) != null;
+ }
static fromObject(data: {
id?: string;
up?: boolean;
@@ -1406,6 +1442,7 @@ export namespace state {
tailOffset?: number;
tailDevicePort?: string;
btmState?: ReturnType;
+ tcc?: ReturnType;
connState?: ReturnType;
}): TrainState {
const message = new TrainState({});
@@ -1478,6 +1515,9 @@ export namespace state {
if (data.btmState != null) {
message.btmState = BTMState.fromObject(data.btmState);
}
+ if (data.tcc != null) {
+ message.tcc = TrainControlState.fromObject(data.tcc);
+ }
if (data.connState != null) {
message.connState = TrainConnState.fromObject(data.connState);
}
@@ -1508,6 +1548,7 @@ export namespace state {
tailOffset?: number;
tailDevicePort?: string;
btmState?: ReturnType;
+ tcc?: ReturnType;
connState?: ReturnType;
} = {};
if (this.id != null) {
@@ -1579,6 +1620,9 @@ export namespace state {
if (this.btmState != null) {
data.btmState = this.btmState.toObject();
}
+ if (this.tcc != null) {
+ data.tcc = this.tcc.toObject();
+ }
if (this.connState != null) {
data.connState = this.connState.toObject();
}
@@ -1634,8 +1678,10 @@ export namespace state {
writer.writeString(22, this.tailDevicePort);
if (this.has_btmState)
writer.writeMessage(23, this.btmState, () => this.btmState.serialize(writer));
+ if (this.has_tcc)
+ writer.writeMessage(24, this.tcc, () => this.tcc.serialize(writer));
if (this.has_connState)
- writer.writeMessage(24, this.connState, () => this.connState.serialize(writer));
+ writer.writeMessage(25, this.connState, () => this.connState.serialize(writer));
if (!w)
return writer.getResultBuffer();
}
@@ -1715,6 +1761,9 @@ export namespace state {
reader.readMessage(message.btmState, () => message.btmState = BTMState.deserialize(reader));
break;
case 24:
+ reader.readMessage(message.tcc, () => message.tcc = TrainControlState.deserialize(reader));
+ break;
+ case 25:
reader.readMessage(message.connState, () => message.connState = TrainConnState.deserialize(reader));
break;
default: reader.skipField();
@@ -7715,4 +7764,534 @@ export namespace state {
return SimulationThirdPartyApiServiceState.deserialize(bytes);
}
}
+ export class TrainControlState extends pb_1.Message {
+ #one_of_decls: number[][] = [];
+ constructor(data?: any[] | {
+ ebutton?: TrainControlState.EmergentButton;
+ driverKey?: TrainControlState.DriverKeySwitch[];
+ dirKey?: TrainControlState.DirectionKeySwitch;
+ pushHandler?: TrainControlState.PushHandler;
+ }) {
+ super();
+ pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], this.#one_of_decls);
+ if (!Array.isArray(data) && typeof data == "object") {
+ if ("ebutton" in data && data.ebutton != undefined) {
+ this.ebutton = data.ebutton;
+ }
+ if ("driverKey" in data && data.driverKey != undefined) {
+ this.driverKey = data.driverKey;
+ }
+ if ("dirKey" in data && data.dirKey != undefined) {
+ this.dirKey = data.dirKey;
+ }
+ if ("pushHandler" in data && data.pushHandler != undefined) {
+ this.pushHandler = data.pushHandler;
+ }
+ }
+ }
+ get ebutton() {
+ return pb_1.Message.getWrapperField(this, TrainControlState.EmergentButton, 1) as TrainControlState.EmergentButton;
+ }
+ set ebutton(value: TrainControlState.EmergentButton) {
+ pb_1.Message.setWrapperField(this, 1, value);
+ }
+ get has_ebutton() {
+ return pb_1.Message.getField(this, 1) != null;
+ }
+ get driverKey() {
+ return pb_1.Message.getRepeatedWrapperField(this, TrainControlState.DriverKeySwitch, 2) as TrainControlState.DriverKeySwitch[];
+ }
+ set driverKey(value: TrainControlState.DriverKeySwitch[]) {
+ pb_1.Message.setRepeatedWrapperField(this, 2, value);
+ }
+ get dirKey() {
+ return pb_1.Message.getWrapperField(this, TrainControlState.DirectionKeySwitch, 3) as TrainControlState.DirectionKeySwitch;
+ }
+ set dirKey(value: TrainControlState.DirectionKeySwitch) {
+ pb_1.Message.setWrapperField(this, 3, value);
+ }
+ get has_dirKey() {
+ return pb_1.Message.getField(this, 3) != null;
+ }
+ get pushHandler() {
+ return pb_1.Message.getWrapperField(this, TrainControlState.PushHandler, 4) as TrainControlState.PushHandler;
+ }
+ set pushHandler(value: TrainControlState.PushHandler) {
+ pb_1.Message.setWrapperField(this, 4, value);
+ }
+ get has_pushHandler() {
+ return pb_1.Message.getField(this, 4) != null;
+ }
+ static fromObject(data: {
+ ebutton?: ReturnType;
+ driverKey?: ReturnType[];
+ dirKey?: ReturnType;
+ pushHandler?: ReturnType;
+ }): TrainControlState {
+ const message = new TrainControlState({});
+ if (data.ebutton != null) {
+ message.ebutton = TrainControlState.EmergentButton.fromObject(data.ebutton);
+ }
+ if (data.driverKey != null) {
+ message.driverKey = data.driverKey.map(item => TrainControlState.DriverKeySwitch.fromObject(item));
+ }
+ if (data.dirKey != null) {
+ message.dirKey = TrainControlState.DirectionKeySwitch.fromObject(data.dirKey);
+ }
+ if (data.pushHandler != null) {
+ message.pushHandler = TrainControlState.PushHandler.fromObject(data.pushHandler);
+ }
+ return message;
+ }
+ toObject() {
+ const data: {
+ ebutton?: ReturnType;
+ driverKey?: ReturnType[];
+ dirKey?: ReturnType;
+ pushHandler?: ReturnType;
+ } = {};
+ if (this.ebutton != null) {
+ data.ebutton = this.ebutton.toObject();
+ }
+ if (this.driverKey != null) {
+ data.driverKey = this.driverKey.map((item: TrainControlState.DriverKeySwitch) => item.toObject());
+ }
+ if (this.dirKey != null) {
+ data.dirKey = this.dirKey.toObject();
+ }
+ if (this.pushHandler != null) {
+ data.pushHandler = this.pushHandler.toObject();
+ }
+ return data;
+ }
+ serialize(): Uint8Array;
+ serialize(w: pb_1.BinaryWriter): void;
+ serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
+ const writer = w || new pb_1.BinaryWriter();
+ if (this.has_ebutton)
+ writer.writeMessage(1, this.ebutton, () => this.ebutton.serialize(writer));
+ if (this.driverKey.length)
+ writer.writeRepeatedMessage(2, this.driverKey, (item: TrainControlState.DriverKeySwitch) => item.serialize(writer));
+ if (this.has_dirKey)
+ writer.writeMessage(3, this.dirKey, () => this.dirKey.serialize(writer));
+ if (this.has_pushHandler)
+ writer.writeMessage(4, this.pushHandler, () => this.pushHandler.serialize(writer));
+ if (!w)
+ return writer.getResultBuffer();
+ }
+ static deserialize(bytes: Uint8Array | pb_1.BinaryReader): TrainControlState {
+ const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new TrainControlState();
+ while (reader.nextField()) {
+ if (reader.isEndGroup())
+ break;
+ switch (reader.getFieldNumber()) {
+ case 1:
+ reader.readMessage(message.ebutton, () => message.ebutton = TrainControlState.EmergentButton.deserialize(reader));
+ break;
+ case 2:
+ reader.readMessage(message.driverKey, () => pb_1.Message.addToRepeatedWrapperField(message, 2, TrainControlState.DriverKeySwitch.deserialize(reader), TrainControlState.DriverKeySwitch));
+ break;
+ case 3:
+ reader.readMessage(message.dirKey, () => message.dirKey = TrainControlState.DirectionKeySwitch.deserialize(reader));
+ break;
+ case 4:
+ reader.readMessage(message.pushHandler, () => message.pushHandler = TrainControlState.PushHandler.deserialize(reader));
+ break;
+ default: reader.skipField();
+ }
+ }
+ return message;
+ }
+ serializeBinary(): Uint8Array {
+ return this.serialize();
+ }
+ static deserializeBinary(bytes: Uint8Array): TrainControlState {
+ return TrainControlState.deserialize(bytes);
+ }
+ }
+ export namespace TrainControlState {
+ export class EmergentButton extends pb_1.Message {
+ #one_of_decls: number[][] = [];
+ constructor(data?: any[] | {
+ id?: number;
+ passed?: boolean;
+ }) {
+ super();
+ pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
+ if (!Array.isArray(data) && typeof data == "object") {
+ if ("id" in data && data.id != undefined) {
+ this.id = data.id;
+ }
+ if ("passed" in data && data.passed != undefined) {
+ this.passed = data.passed;
+ }
+ }
+ }
+ get id() {
+ return pb_1.Message.getFieldWithDefault(this, 1, 0) as number;
+ }
+ set id(value: number) {
+ pb_1.Message.setField(this, 1, value);
+ }
+ get passed() {
+ return pb_1.Message.getFieldWithDefault(this, 3, false) as boolean;
+ }
+ set passed(value: boolean) {
+ pb_1.Message.setField(this, 3, value);
+ }
+ static fromObject(data: {
+ id?: number;
+ passed?: boolean;
+ }): EmergentButton {
+ const message = new EmergentButton({});
+ if (data.id != null) {
+ message.id = data.id;
+ }
+ if (data.passed != null) {
+ message.passed = data.passed;
+ }
+ return message;
+ }
+ toObject() {
+ const data: {
+ id?: number;
+ passed?: boolean;
+ } = {};
+ if (this.id != null) {
+ data.id = this.id;
+ }
+ if (this.passed != null) {
+ data.passed = this.passed;
+ }
+ return data;
+ }
+ serialize(): Uint8Array;
+ serialize(w: pb_1.BinaryWriter): void;
+ serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
+ const writer = w || new pb_1.BinaryWriter();
+ if (this.id != 0)
+ writer.writeUint32(1, this.id);
+ if (this.passed != false)
+ writer.writeBool(3, this.passed);
+ if (!w)
+ return writer.getResultBuffer();
+ }
+ static deserialize(bytes: Uint8Array | pb_1.BinaryReader): EmergentButton {
+ const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new EmergentButton();
+ while (reader.nextField()) {
+ if (reader.isEndGroup())
+ break;
+ switch (reader.getFieldNumber()) {
+ case 1:
+ message.id = reader.readUint32();
+ break;
+ case 3:
+ message.passed = reader.readBool();
+ break;
+ default: reader.skipField();
+ }
+ }
+ return message;
+ }
+ serializeBinary(): Uint8Array {
+ return this.serialize();
+ }
+ static deserializeBinary(bytes: Uint8Array): EmergentButton {
+ return EmergentButton.deserialize(bytes);
+ }
+ }
+ export class DriverKeySwitch extends pb_1.Message {
+ #one_of_decls: number[][] = [];
+ constructor(data?: any[] | {
+ id?: number;
+ val?: boolean;
+ dt?: dependency_3.request.DriverType;
+ }) {
+ super();
+ pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
+ if (!Array.isArray(data) && typeof data == "object") {
+ if ("id" in data && data.id != undefined) {
+ this.id = data.id;
+ }
+ if ("val" in data && data.val != undefined) {
+ this.val = data.val;
+ }
+ if ("dt" in data && data.dt != undefined) {
+ this.dt = data.dt;
+ }
+ }
+ }
+ get id() {
+ return pb_1.Message.getFieldWithDefault(this, 1, 0) as number;
+ }
+ set id(value: number) {
+ pb_1.Message.setField(this, 1, value);
+ }
+ get val() {
+ return pb_1.Message.getFieldWithDefault(this, 2, false) as boolean;
+ }
+ set val(value: boolean) {
+ pb_1.Message.setField(this, 2, value);
+ }
+ get dt() {
+ return pb_1.Message.getFieldWithDefault(this, 3, dependency_3.request.DriverType.ONE_END) as dependency_3.request.DriverType;
+ }
+ set dt(value: dependency_3.request.DriverType) {
+ pb_1.Message.setField(this, 3, value);
+ }
+ static fromObject(data: {
+ id?: number;
+ val?: boolean;
+ dt?: dependency_3.request.DriverType;
+ }): DriverKeySwitch {
+ const message = new DriverKeySwitch({});
+ if (data.id != null) {
+ message.id = data.id;
+ }
+ if (data.val != null) {
+ message.val = data.val;
+ }
+ if (data.dt != null) {
+ message.dt = data.dt;
+ }
+ return message;
+ }
+ toObject() {
+ const data: {
+ id?: number;
+ val?: boolean;
+ dt?: dependency_3.request.DriverType;
+ } = {};
+ if (this.id != null) {
+ data.id = this.id;
+ }
+ if (this.val != null) {
+ data.val = this.val;
+ }
+ if (this.dt != null) {
+ data.dt = this.dt;
+ }
+ return data;
+ }
+ serialize(): Uint8Array;
+ serialize(w: pb_1.BinaryWriter): void;
+ serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
+ const writer = w || new pb_1.BinaryWriter();
+ if (this.id != 0)
+ writer.writeUint32(1, this.id);
+ if (this.val != false)
+ writer.writeBool(2, this.val);
+ if (this.dt != dependency_3.request.DriverType.ONE_END)
+ writer.writeEnum(3, this.dt);
+ if (!w)
+ return writer.getResultBuffer();
+ }
+ static deserialize(bytes: Uint8Array | pb_1.BinaryReader): DriverKeySwitch {
+ const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new DriverKeySwitch();
+ while (reader.nextField()) {
+ if (reader.isEndGroup())
+ break;
+ switch (reader.getFieldNumber()) {
+ case 1:
+ message.id = reader.readUint32();
+ break;
+ case 2:
+ message.val = reader.readBool();
+ break;
+ case 3:
+ message.dt = reader.readEnum();
+ break;
+ default: reader.skipField();
+ }
+ }
+ return message;
+ }
+ serializeBinary(): Uint8Array {
+ return this.serialize();
+ }
+ static deserializeBinary(bytes: Uint8Array): DriverKeySwitch {
+ return DriverKeySwitch.deserialize(bytes);
+ }
+ }
+ export class DirectionKeySwitch extends pb_1.Message {
+ #one_of_decls: number[][] = [];
+ constructor(data?: any[] | {
+ id?: number;
+ val?: number;
+ }) {
+ super();
+ pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
+ if (!Array.isArray(data) && typeof data == "object") {
+ if ("id" in data && data.id != undefined) {
+ this.id = data.id;
+ }
+ if ("val" in data && data.val != undefined) {
+ this.val = data.val;
+ }
+ }
+ }
+ get id() {
+ return pb_1.Message.getFieldWithDefault(this, 1, 0) as number;
+ }
+ set id(value: number) {
+ pb_1.Message.setField(this, 1, value);
+ }
+ get val() {
+ return pb_1.Message.getFieldWithDefault(this, 2, 0) as number;
+ }
+ set val(value: number) {
+ pb_1.Message.setField(this, 2, value);
+ }
+ static fromObject(data: {
+ id?: number;
+ val?: number;
+ }): DirectionKeySwitch {
+ const message = new DirectionKeySwitch({});
+ if (data.id != null) {
+ message.id = data.id;
+ }
+ if (data.val != null) {
+ message.val = data.val;
+ }
+ return message;
+ }
+ toObject() {
+ const data: {
+ id?: number;
+ val?: number;
+ } = {};
+ if (this.id != null) {
+ data.id = this.id;
+ }
+ if (this.val != null) {
+ data.val = this.val;
+ }
+ return data;
+ }
+ serialize(): Uint8Array;
+ serialize(w: pb_1.BinaryWriter): void;
+ serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
+ const writer = w || new pb_1.BinaryWriter();
+ if (this.id != 0)
+ writer.writeUint32(1, this.id);
+ if (this.val != 0)
+ writer.writeUint32(2, this.val);
+ if (!w)
+ return writer.getResultBuffer();
+ }
+ static deserialize(bytes: Uint8Array | pb_1.BinaryReader): DirectionKeySwitch {
+ const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new DirectionKeySwitch();
+ while (reader.nextField()) {
+ if (reader.isEndGroup())
+ break;
+ switch (reader.getFieldNumber()) {
+ case 1:
+ message.id = reader.readUint32();
+ break;
+ case 2:
+ message.val = reader.readUint32();
+ break;
+ default: reader.skipField();
+ }
+ }
+ return message;
+ }
+ serializeBinary(): Uint8Array {
+ return this.serialize();
+ }
+ static deserializeBinary(bytes: Uint8Array): DirectionKeySwitch {
+ return DirectionKeySwitch.deserialize(bytes);
+ }
+ }
+ export class PushHandler extends pb_1.Message {
+ #one_of_decls: number[][] = [];
+ constructor(data?: any[] | {
+ id?: number;
+ val?: number;
+ }) {
+ super();
+ pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
+ if (!Array.isArray(data) && typeof data == "object") {
+ if ("id" in data && data.id != undefined) {
+ this.id = data.id;
+ }
+ if ("val" in data && data.val != undefined) {
+ this.val = data.val;
+ }
+ }
+ }
+ get id() {
+ return pb_1.Message.getFieldWithDefault(this, 1, 0) as number;
+ }
+ set id(value: number) {
+ pb_1.Message.setField(this, 1, value);
+ }
+ get val() {
+ return pb_1.Message.getFieldWithDefault(this, 2, 0) as number;
+ }
+ set val(value: number) {
+ pb_1.Message.setField(this, 2, value);
+ }
+ static fromObject(data: {
+ id?: number;
+ val?: number;
+ }): PushHandler {
+ const message = new PushHandler({});
+ if (data.id != null) {
+ message.id = data.id;
+ }
+ if (data.val != null) {
+ message.val = data.val;
+ }
+ return message;
+ }
+ toObject() {
+ const data: {
+ id?: number;
+ val?: number;
+ } = {};
+ if (this.id != null) {
+ data.id = this.id;
+ }
+ if (this.val != null) {
+ data.val = this.val;
+ }
+ return data;
+ }
+ serialize(): Uint8Array;
+ serialize(w: pb_1.BinaryWriter): void;
+ serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
+ const writer = w || new pb_1.BinaryWriter();
+ if (this.id != 0)
+ writer.writeUint32(1, this.id);
+ if (this.val != 0)
+ writer.writeInt32(2, this.val);
+ if (!w)
+ return writer.getResultBuffer();
+ }
+ static deserialize(bytes: Uint8Array | pb_1.BinaryReader): PushHandler {
+ const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new PushHandler();
+ while (reader.nextField()) {
+ if (reader.isEndGroup())
+ break;
+ switch (reader.getFieldNumber()) {
+ case 1:
+ message.id = reader.readUint32();
+ break;
+ case 2:
+ message.val = reader.readInt32();
+ break;
+ default: reader.skipField();
+ }
+ }
+ return message;
+ }
+ serializeBinary(): Uint8Array {
+ return this.serialize();
+ }
+ static deserializeBinary(bytes: Uint8Array): PushHandler {
+ return PushHandler.deserialize(bytes);
+ }
+ }
+ }
}
diff --git a/src/protos/request.ts b/src/protos/request.ts
index 8131022..607b054 100644
--- a/src/protos/request.ts
+++ b/src/protos/request.ts
@@ -5,6 +5,10 @@
* git: https://github.com/thesayyn/protoc-gen-ts */
import * as pb_1 from "google-protobuf";
export namespace request {
+ export enum DriverType {
+ ONE_END = 0,
+ TWO_END = 1
+ }
export class Relay extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {}) {
@@ -1414,4 +1418,1009 @@ export namespace request {
return PsdParam.deserialize(bytes);
}
}
+ export class TrainControl extends pb_1.Message {
+ #one_of_decls: number[][] = [];
+ constructor(data?: any[] | {
+ simulationId?: string;
+ trainId?: number;
+ deviceId?: number;
+ controlType?: TrainControl.TrainControlType;
+ button?: TrainControl.EmergentButton;
+ driverKey?: TrainControl.DriverKeySwitch;
+ dirKey?: TrainControl.DirectionKeySwitch;
+ handler?: TrainControl.PushHandler;
+ }) {
+ super();
+ pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
+ if (!Array.isArray(data) && typeof data == "object") {
+ if ("simulationId" in data && data.simulationId != undefined) {
+ this.simulationId = data.simulationId;
+ }
+ if ("trainId" in data && data.trainId != undefined) {
+ this.trainId = data.trainId;
+ }
+ if ("deviceId" in data && data.deviceId != undefined) {
+ this.deviceId = data.deviceId;
+ }
+ if ("controlType" in data && data.controlType != undefined) {
+ this.controlType = data.controlType;
+ }
+ if ("button" in data && data.button != undefined) {
+ this.button = data.button;
+ }
+ if ("driverKey" in data && data.driverKey != undefined) {
+ this.driverKey = data.driverKey;
+ }
+ if ("dirKey" in data && data.dirKey != undefined) {
+ this.dirKey = data.dirKey;
+ }
+ if ("handler" in data && data.handler != undefined) {
+ this.handler = data.handler;
+ }
+ }
+ }
+ get simulationId() {
+ return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
+ }
+ set simulationId(value: string) {
+ pb_1.Message.setField(this, 1, value);
+ }
+ get trainId() {
+ return pb_1.Message.getFieldWithDefault(this, 2, 0) as number;
+ }
+ set trainId(value: number) {
+ pb_1.Message.setField(this, 2, value);
+ }
+ get deviceId() {
+ return pb_1.Message.getFieldWithDefault(this, 3, 0) as number;
+ }
+ set deviceId(value: number) {
+ pb_1.Message.setField(this, 3, value);
+ }
+ get controlType() {
+ return pb_1.Message.getFieldWithDefault(this, 4, TrainControl.TrainControlType.EMERGENT_BUTTON) as TrainControl.TrainControlType;
+ }
+ set controlType(value: TrainControl.TrainControlType) {
+ pb_1.Message.setField(this, 4, value);
+ }
+ get button() {
+ return pb_1.Message.getWrapperField(this, TrainControl.EmergentButton, 5) as TrainControl.EmergentButton;
+ }
+ set button(value: TrainControl.EmergentButton) {
+ pb_1.Message.setWrapperField(this, 5, value);
+ }
+ get has_button() {
+ return pb_1.Message.getField(this, 5) != null;
+ }
+ get driverKey() {
+ return pb_1.Message.getWrapperField(this, TrainControl.DriverKeySwitch, 6) as TrainControl.DriverKeySwitch;
+ }
+ set driverKey(value: TrainControl.DriverKeySwitch) {
+ pb_1.Message.setWrapperField(this, 6, value);
+ }
+ get has_driverKey() {
+ return pb_1.Message.getField(this, 6) != null;
+ }
+ get dirKey() {
+ return pb_1.Message.getWrapperField(this, TrainControl.DirectionKeySwitch, 7) as TrainControl.DirectionKeySwitch;
+ }
+ set dirKey(value: TrainControl.DirectionKeySwitch) {
+ pb_1.Message.setWrapperField(this, 7, value);
+ }
+ get has_dirKey() {
+ return pb_1.Message.getField(this, 7) != null;
+ }
+ get handler() {
+ return pb_1.Message.getWrapperField(this, TrainControl.PushHandler, 8) as TrainControl.PushHandler;
+ }
+ set handler(value: TrainControl.PushHandler) {
+ pb_1.Message.setWrapperField(this, 8, value);
+ }
+ get has_handler() {
+ return pb_1.Message.getField(this, 8) != null;
+ }
+ static fromObject(data: {
+ simulationId?: string;
+ trainId?: number;
+ deviceId?: number;
+ controlType?: TrainControl.TrainControlType;
+ button?: ReturnType;
+ driverKey?: ReturnType;
+ dirKey?: ReturnType;
+ handler?: ReturnType;
+ }): TrainControl {
+ const message = new TrainControl({});
+ if (data.simulationId != null) {
+ message.simulationId = data.simulationId;
+ }
+ if (data.trainId != null) {
+ message.trainId = data.trainId;
+ }
+ if (data.deviceId != null) {
+ message.deviceId = data.deviceId;
+ }
+ if (data.controlType != null) {
+ message.controlType = data.controlType;
+ }
+ if (data.button != null) {
+ message.button = TrainControl.EmergentButton.fromObject(data.button);
+ }
+ if (data.driverKey != null) {
+ message.driverKey = TrainControl.DriverKeySwitch.fromObject(data.driverKey);
+ }
+ if (data.dirKey != null) {
+ message.dirKey = TrainControl.DirectionKeySwitch.fromObject(data.dirKey);
+ }
+ if (data.handler != null) {
+ message.handler = TrainControl.PushHandler.fromObject(data.handler);
+ }
+ return message;
+ }
+ toObject() {
+ const data: {
+ simulationId?: string;
+ trainId?: number;
+ deviceId?: number;
+ controlType?: TrainControl.TrainControlType;
+ button?: ReturnType;
+ driverKey?: ReturnType;
+ dirKey?: ReturnType;
+ handler?: ReturnType;
+ } = {};
+ if (this.simulationId != null) {
+ data.simulationId = this.simulationId;
+ }
+ if (this.trainId != null) {
+ data.trainId = this.trainId;
+ }
+ if (this.deviceId != null) {
+ data.deviceId = this.deviceId;
+ }
+ if (this.controlType != null) {
+ data.controlType = this.controlType;
+ }
+ if (this.button != null) {
+ data.button = this.button.toObject();
+ }
+ if (this.driverKey != null) {
+ data.driverKey = this.driverKey.toObject();
+ }
+ if (this.dirKey != null) {
+ data.dirKey = this.dirKey.toObject();
+ }
+ if (this.handler != null) {
+ data.handler = this.handler.toObject();
+ }
+ return data;
+ }
+ serialize(): Uint8Array;
+ serialize(w: pb_1.BinaryWriter): void;
+ serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
+ const writer = w || new pb_1.BinaryWriter();
+ if (this.simulationId.length)
+ writer.writeString(1, this.simulationId);
+ if (this.trainId != 0)
+ writer.writeUint32(2, this.trainId);
+ if (this.deviceId != 0)
+ writer.writeUint32(3, this.deviceId);
+ if (this.controlType != TrainControl.TrainControlType.EMERGENT_BUTTON)
+ writer.writeEnum(4, this.controlType);
+ if (this.has_button)
+ writer.writeMessage(5, this.button, () => this.button.serialize(writer));
+ if (this.has_driverKey)
+ writer.writeMessage(6, this.driverKey, () => this.driverKey.serialize(writer));
+ if (this.has_dirKey)
+ writer.writeMessage(7, this.dirKey, () => this.dirKey.serialize(writer));
+ if (this.has_handler)
+ writer.writeMessage(8, this.handler, () => this.handler.serialize(writer));
+ if (!w)
+ return writer.getResultBuffer();
+ }
+ static deserialize(bytes: Uint8Array | pb_1.BinaryReader): TrainControl {
+ const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new TrainControl();
+ while (reader.nextField()) {
+ if (reader.isEndGroup())
+ break;
+ switch (reader.getFieldNumber()) {
+ case 1:
+ message.simulationId = reader.readString();
+ break;
+ case 2:
+ message.trainId = reader.readUint32();
+ break;
+ case 3:
+ message.deviceId = reader.readUint32();
+ break;
+ case 4:
+ message.controlType = reader.readEnum();
+ break;
+ case 5:
+ reader.readMessage(message.button, () => message.button = TrainControl.EmergentButton.deserialize(reader));
+ break;
+ case 6:
+ reader.readMessage(message.driverKey, () => message.driverKey = TrainControl.DriverKeySwitch.deserialize(reader));
+ break;
+ case 7:
+ reader.readMessage(message.dirKey, () => message.dirKey = TrainControl.DirectionKeySwitch.deserialize(reader));
+ break;
+ case 8:
+ reader.readMessage(message.handler, () => message.handler = TrainControl.PushHandler.deserialize(reader));
+ break;
+ default: reader.skipField();
+ }
+ }
+ return message;
+ }
+ serializeBinary(): Uint8Array {
+ return this.serialize();
+ }
+ static deserializeBinary(bytes: Uint8Array): TrainControl {
+ return TrainControl.deserialize(bytes);
+ }
+ }
+ export namespace TrainControl {
+ export enum TrainControlType {
+ EMERGENT_BUTTON = 0,
+ DRIVER_KEY_SWITCH = 1,
+ DIRECTION_KEY_SWITCH = 2,
+ HANDLER = 3
+ }
+ export class EmergentButton extends pb_1.Message {
+ #one_of_decls: number[][] = [];
+ constructor(data?: any[] | {
+ active?: boolean;
+ }) {
+ super();
+ pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
+ if (!Array.isArray(data) && typeof data == "object") {
+ if ("active" in data && data.active != undefined) {
+ this.active = data.active;
+ }
+ }
+ }
+ get active() {
+ return pb_1.Message.getFieldWithDefault(this, 1, false) as boolean;
+ }
+ set active(value: boolean) {
+ pb_1.Message.setField(this, 1, value);
+ }
+ static fromObject(data: {
+ active?: boolean;
+ }): EmergentButton {
+ const message = new EmergentButton({});
+ if (data.active != null) {
+ message.active = data.active;
+ }
+ return message;
+ }
+ toObject() {
+ const data: {
+ active?: boolean;
+ } = {};
+ if (this.active != null) {
+ data.active = this.active;
+ }
+ return data;
+ }
+ serialize(): Uint8Array;
+ serialize(w: pb_1.BinaryWriter): void;
+ serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
+ const writer = w || new pb_1.BinaryWriter();
+ if (this.active != false)
+ writer.writeBool(1, this.active);
+ if (!w)
+ return writer.getResultBuffer();
+ }
+ static deserialize(bytes: Uint8Array | pb_1.BinaryReader): EmergentButton {
+ const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new EmergentButton();
+ while (reader.nextField()) {
+ if (reader.isEndGroup())
+ break;
+ switch (reader.getFieldNumber()) {
+ case 1:
+ message.active = reader.readBool();
+ break;
+ default: reader.skipField();
+ }
+ }
+ return message;
+ }
+ serializeBinary(): Uint8Array {
+ return this.serialize();
+ }
+ static deserializeBinary(bytes: Uint8Array): EmergentButton {
+ return EmergentButton.deserialize(bytes);
+ }
+ }
+ export class DriverKeySwitch extends pb_1.Message {
+ #one_of_decls: number[][] = [];
+ constructor(data?: any[] | {
+ val?: boolean;
+ dt?: DriverType;
+ }) {
+ super();
+ pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
+ if (!Array.isArray(data) && typeof data == "object") {
+ if ("val" in data && data.val != undefined) {
+ this.val = data.val;
+ }
+ if ("dt" in data && data.dt != undefined) {
+ this.dt = data.dt;
+ }
+ }
+ }
+ get val() {
+ return pb_1.Message.getFieldWithDefault(this, 1, false) as boolean;
+ }
+ set val(value: boolean) {
+ pb_1.Message.setField(this, 1, value);
+ }
+ get dt() {
+ return pb_1.Message.getFieldWithDefault(this, 2, DriverType.ONE_END) as DriverType;
+ }
+ set dt(value: DriverType) {
+ pb_1.Message.setField(this, 2, value);
+ }
+ static fromObject(data: {
+ val?: boolean;
+ dt?: DriverType;
+ }): DriverKeySwitch {
+ const message = new DriverKeySwitch({});
+ if (data.val != null) {
+ message.val = data.val;
+ }
+ if (data.dt != null) {
+ message.dt = data.dt;
+ }
+ return message;
+ }
+ toObject() {
+ const data: {
+ val?: boolean;
+ dt?: DriverType;
+ } = {};
+ if (this.val != null) {
+ data.val = this.val;
+ }
+ if (this.dt != null) {
+ data.dt = this.dt;
+ }
+ return data;
+ }
+ serialize(): Uint8Array;
+ serialize(w: pb_1.BinaryWriter): void;
+ serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
+ const writer = w || new pb_1.BinaryWriter();
+ if (this.val != false)
+ writer.writeBool(1, this.val);
+ if (this.dt != DriverType.ONE_END)
+ writer.writeEnum(2, this.dt);
+ if (!w)
+ return writer.getResultBuffer();
+ }
+ static deserialize(bytes: Uint8Array | pb_1.BinaryReader): DriverKeySwitch {
+ const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new DriverKeySwitch();
+ while (reader.nextField()) {
+ if (reader.isEndGroup())
+ break;
+ switch (reader.getFieldNumber()) {
+ case 1:
+ message.val = reader.readBool();
+ break;
+ case 2:
+ message.dt = reader.readEnum();
+ break;
+ default: reader.skipField();
+ }
+ }
+ return message;
+ }
+ serializeBinary(): Uint8Array {
+ return this.serialize();
+ }
+ static deserializeBinary(bytes: Uint8Array): DriverKeySwitch {
+ return DriverKeySwitch.deserialize(bytes);
+ }
+ }
+ export class DirectionKeySwitch extends pb_1.Message {
+ #one_of_decls: number[][] = [];
+ constructor(data?: any[] | {
+ val?: number;
+ }) {
+ super();
+ pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
+ if (!Array.isArray(data) && typeof data == "object") {
+ if ("val" in data && data.val != undefined) {
+ this.val = data.val;
+ }
+ }
+ }
+ get val() {
+ return pb_1.Message.getFieldWithDefault(this, 1, 0) as number;
+ }
+ set val(value: number) {
+ pb_1.Message.setField(this, 1, value);
+ }
+ static fromObject(data: {
+ val?: number;
+ }): DirectionKeySwitch {
+ const message = new DirectionKeySwitch({});
+ if (data.val != null) {
+ message.val = data.val;
+ }
+ return message;
+ }
+ toObject() {
+ const data: {
+ val?: number;
+ } = {};
+ if (this.val != null) {
+ data.val = this.val;
+ }
+ return data;
+ }
+ serialize(): Uint8Array;
+ serialize(w: pb_1.BinaryWriter): void;
+ serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
+ const writer = w || new pb_1.BinaryWriter();
+ if (this.val != 0)
+ writer.writeUint32(1, this.val);
+ if (!w)
+ return writer.getResultBuffer();
+ }
+ static deserialize(bytes: Uint8Array | pb_1.BinaryReader): DirectionKeySwitch {
+ const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new DirectionKeySwitch();
+ while (reader.nextField()) {
+ if (reader.isEndGroup())
+ break;
+ switch (reader.getFieldNumber()) {
+ case 1:
+ message.val = reader.readUint32();
+ break;
+ default: reader.skipField();
+ }
+ }
+ return message;
+ }
+ serializeBinary(): Uint8Array {
+ return this.serialize();
+ }
+ static deserializeBinary(bytes: Uint8Array): DirectionKeySwitch {
+ return DirectionKeySwitch.deserialize(bytes);
+ }
+ }
+ export class PushHandler extends pb_1.Message {
+ #one_of_decls: number[][] = [];
+ constructor(data?: any[] | {
+ val?: number;
+ }) {
+ super();
+ pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
+ if (!Array.isArray(data) && typeof data == "object") {
+ if ("val" in data && data.val != undefined) {
+ this.val = data.val;
+ }
+ }
+ }
+ get val() {
+ return pb_1.Message.getFieldWithDefault(this, 1, 0) as number;
+ }
+ set val(value: number) {
+ pb_1.Message.setField(this, 1, value);
+ }
+ static fromObject(data: {
+ val?: number;
+ }): PushHandler {
+ const message = new PushHandler({});
+ if (data.val != null) {
+ message.val = data.val;
+ }
+ return message;
+ }
+ toObject() {
+ const data: {
+ val?: number;
+ } = {};
+ if (this.val != null) {
+ data.val = this.val;
+ }
+ return data;
+ }
+ serialize(): Uint8Array;
+ serialize(w: pb_1.BinaryWriter): void;
+ serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
+ const writer = w || new pb_1.BinaryWriter();
+ if (this.val != 0)
+ writer.writeInt32(1, this.val);
+ if (!w)
+ return writer.getResultBuffer();
+ }
+ static deserialize(bytes: Uint8Array | pb_1.BinaryReader): PushHandler {
+ const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new PushHandler();
+ while (reader.nextField()) {
+ if (reader.isEndGroup())
+ break;
+ switch (reader.getFieldNumber()) {
+ case 1:
+ message.val = reader.readInt32();
+ break;
+ default: reader.skipField();
+ }
+ }
+ return message;
+ }
+ serializeBinary(): Uint8Array {
+ return this.serialize();
+ }
+ static deserializeBinary(bytes: Uint8Array): PushHandler {
+ return PushHandler.deserialize(bytes);
+ }
+ }
+ }
+ export class CkmOperationReq extends pb_1.Message {
+ #one_of_decls: number[][] = [];
+ constructor(data?: any[] | {
+ simulationId?: string;
+ mapId?: number;
+ deviceId?: number;
+ operation?: Ckm.Operation;
+ param?: CkmParam;
+ }) {
+ super();
+ pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
+ if (!Array.isArray(data) && typeof data == "object") {
+ if ("simulationId" in data && data.simulationId != undefined) {
+ this.simulationId = data.simulationId;
+ }
+ if ("mapId" in data && data.mapId != undefined) {
+ this.mapId = data.mapId;
+ }
+ if ("deviceId" in data && data.deviceId != undefined) {
+ this.deviceId = data.deviceId;
+ }
+ if ("operation" in data && data.operation != undefined) {
+ this.operation = data.operation;
+ }
+ if ("param" in data && data.param != undefined) {
+ this.param = data.param;
+ }
+ }
+ }
+ get simulationId() {
+ return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
+ }
+ set simulationId(value: string) {
+ pb_1.Message.setField(this, 1, value);
+ }
+ get mapId() {
+ return pb_1.Message.getFieldWithDefault(this, 2, 0) as number;
+ }
+ set mapId(value: number) {
+ pb_1.Message.setField(this, 2, value);
+ }
+ get deviceId() {
+ return pb_1.Message.getFieldWithDefault(this, 3, 0) as number;
+ }
+ set deviceId(value: number) {
+ pb_1.Message.setField(this, 3, value);
+ }
+ get operation() {
+ return pb_1.Message.getFieldWithDefault(this, 4, Ckm.Operation.Undefined) as Ckm.Operation;
+ }
+ set operation(value: Ckm.Operation) {
+ pb_1.Message.setField(this, 4, value);
+ }
+ get param() {
+ return pb_1.Message.getWrapperField(this, CkmParam, 5) as CkmParam;
+ }
+ set param(value: CkmParam) {
+ pb_1.Message.setWrapperField(this, 5, value);
+ }
+ get has_param() {
+ return pb_1.Message.getField(this, 5) != null;
+ }
+ static fromObject(data: {
+ simulationId?: string;
+ mapId?: number;
+ deviceId?: number;
+ operation?: Ckm.Operation;
+ param?: ReturnType;
+ }): CkmOperationReq {
+ const message = new CkmOperationReq({});
+ if (data.simulationId != null) {
+ message.simulationId = data.simulationId;
+ }
+ if (data.mapId != null) {
+ message.mapId = data.mapId;
+ }
+ if (data.deviceId != null) {
+ message.deviceId = data.deviceId;
+ }
+ if (data.operation != null) {
+ message.operation = data.operation;
+ }
+ if (data.param != null) {
+ message.param = CkmParam.fromObject(data.param);
+ }
+ return message;
+ }
+ toObject() {
+ const data: {
+ simulationId?: string;
+ mapId?: number;
+ deviceId?: number;
+ operation?: Ckm.Operation;
+ param?: ReturnType;
+ } = {};
+ if (this.simulationId != null) {
+ data.simulationId = this.simulationId;
+ }
+ if (this.mapId != null) {
+ data.mapId = this.mapId;
+ }
+ if (this.deviceId != null) {
+ data.deviceId = this.deviceId;
+ }
+ if (this.operation != null) {
+ data.operation = this.operation;
+ }
+ if (this.param != null) {
+ data.param = this.param.toObject();
+ }
+ return data;
+ }
+ serialize(): Uint8Array;
+ serialize(w: pb_1.BinaryWriter): void;
+ serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
+ const writer = w || new pb_1.BinaryWriter();
+ if (this.simulationId.length)
+ writer.writeString(1, this.simulationId);
+ if (this.mapId != 0)
+ writer.writeInt32(2, this.mapId);
+ if (this.deviceId != 0)
+ writer.writeUint32(3, this.deviceId);
+ if (this.operation != Ckm.Operation.Undefined)
+ writer.writeEnum(4, this.operation);
+ if (this.has_param)
+ writer.writeMessage(5, this.param, () => this.param.serialize(writer));
+ if (!w)
+ return writer.getResultBuffer();
+ }
+ static deserialize(bytes: Uint8Array | pb_1.BinaryReader): CkmOperationReq {
+ const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new CkmOperationReq();
+ while (reader.nextField()) {
+ if (reader.isEndGroup())
+ break;
+ switch (reader.getFieldNumber()) {
+ case 1:
+ message.simulationId = reader.readString();
+ break;
+ case 2:
+ message.mapId = reader.readInt32();
+ break;
+ case 3:
+ message.deviceId = reader.readUint32();
+ break;
+ case 4:
+ message.operation = reader.readEnum();
+ break;
+ case 5:
+ reader.readMessage(message.param, () => message.param = CkmParam.deserialize(reader));
+ break;
+ default: reader.skipField();
+ }
+ }
+ return message;
+ }
+ serializeBinary(): Uint8Array {
+ return this.serialize();
+ }
+ static deserializeBinary(bytes: Uint8Array): CkmOperationReq {
+ return CkmOperationReq.deserialize(bytes);
+ }
+ }
+ export class Ckm extends pb_1.Message {
+ #one_of_decls: number[][] = [];
+ constructor(data?: any[] | {}) {
+ super();
+ pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
+ if (!Array.isArray(data) && typeof data == "object") { }
+ }
+ static fromObject(data: {}): Ckm {
+ const message = new Ckm({});
+ return message;
+ }
+ toObject() {
+ const data: {} = {};
+ return data;
+ }
+ serialize(): Uint8Array;
+ serialize(w: pb_1.BinaryWriter): void;
+ serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
+ const writer = w || new pb_1.BinaryWriter();
+ if (!w)
+ return writer.getResultBuffer();
+ }
+ static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Ckm {
+ const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Ckm();
+ while (reader.nextField()) {
+ if (reader.isEndGroup())
+ break;
+ switch (reader.getFieldNumber()) {
+ default: reader.skipField();
+ }
+ }
+ return message;
+ }
+ serializeBinary(): Uint8Array {
+ return this.serialize();
+ }
+ static deserializeBinary(bytes: Uint8Array): Ckm {
+ return Ckm.deserialize(bytes);
+ }
+ }
+ export namespace Ckm {
+ export enum Operation {
+ Undefined = 0,
+ SetParams = 1
+ }
+ export enum Force {
+ F_NONE = 0,
+ F_KM = 1,
+ F_GM = 2
+ }
+ export enum Fault {
+ FA_NONE = 0,
+ FA_State_Loss = 1
+ }
+ }
+ export class CkmParam extends pb_1.Message {
+ #one_of_decls: number[][] = [];
+ constructor(data?: any[] | {
+ force?: Ckm.Force;
+ fault?: Ckm.Fault;
+ }) {
+ super();
+ pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
+ if (!Array.isArray(data) && typeof data == "object") {
+ if ("force" in data && data.force != undefined) {
+ this.force = data.force;
+ }
+ if ("fault" in data && data.fault != undefined) {
+ this.fault = data.fault;
+ }
+ }
+ }
+ get force() {
+ return pb_1.Message.getFieldWithDefault(this, 1, Ckm.Force.F_NONE) as Ckm.Force;
+ }
+ set force(value: Ckm.Force) {
+ pb_1.Message.setField(this, 1, value);
+ }
+ get fault() {
+ return pb_1.Message.getFieldWithDefault(this, 2, Ckm.Fault.FA_NONE) as Ckm.Fault;
+ }
+ set fault(value: Ckm.Fault) {
+ pb_1.Message.setField(this, 2, value);
+ }
+ static fromObject(data: {
+ force?: Ckm.Force;
+ fault?: Ckm.Fault;
+ }): CkmParam {
+ const message = new CkmParam({});
+ if (data.force != null) {
+ message.force = data.force;
+ }
+ if (data.fault != null) {
+ message.fault = data.fault;
+ }
+ return message;
+ }
+ toObject() {
+ const data: {
+ force?: Ckm.Force;
+ fault?: Ckm.Fault;
+ } = {};
+ if (this.force != null) {
+ data.force = this.force;
+ }
+ if (this.fault != null) {
+ data.fault = this.fault;
+ }
+ return data;
+ }
+ serialize(): Uint8Array;
+ serialize(w: pb_1.BinaryWriter): void;
+ serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
+ const writer = w || new pb_1.BinaryWriter();
+ if (this.force != Ckm.Force.F_NONE)
+ writer.writeEnum(1, this.force);
+ if (this.fault != Ckm.Fault.FA_NONE)
+ writer.writeEnum(2, this.fault);
+ if (!w)
+ return writer.getResultBuffer();
+ }
+ static deserialize(bytes: Uint8Array | pb_1.BinaryReader): CkmParam {
+ const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new CkmParam();
+ while (reader.nextField()) {
+ if (reader.isEndGroup())
+ break;
+ switch (reader.getFieldNumber()) {
+ case 1:
+ message.force = reader.readEnum();
+ break;
+ case 2:
+ message.fault = reader.readEnum();
+ break;
+ default: reader.skipField();
+ }
+ }
+ return message;
+ }
+ serializeBinary(): Uint8Array {
+ return this.serialize();
+ }
+ static deserializeBinary(bytes: Uint8Array): CkmParam {
+ return CkmParam.deserialize(bytes);
+ }
+ }
+ export class CkmBoxOperationReq extends pb_1.Message {
+ #one_of_decls: number[][] = [];
+ constructor(data?: any[] | {
+ simulationId?: string;
+ mapId?: number;
+ ckmBoxId?: number;
+ buttonCode?: string;
+ down?: boolean;
+ }) {
+ super();
+ pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
+ if (!Array.isArray(data) && typeof data == "object") {
+ if ("simulationId" in data && data.simulationId != undefined) {
+ this.simulationId = data.simulationId;
+ }
+ if ("mapId" in data && data.mapId != undefined) {
+ this.mapId = data.mapId;
+ }
+ if ("ckmBoxId" in data && data.ckmBoxId != undefined) {
+ this.ckmBoxId = data.ckmBoxId;
+ }
+ if ("buttonCode" in data && data.buttonCode != undefined) {
+ this.buttonCode = data.buttonCode;
+ }
+ if ("down" in data && data.down != undefined) {
+ this.down = data.down;
+ }
+ }
+ }
+ get simulationId() {
+ return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
+ }
+ set simulationId(value: string) {
+ pb_1.Message.setField(this, 1, value);
+ }
+ get mapId() {
+ return pb_1.Message.getFieldWithDefault(this, 2, 0) as number;
+ }
+ set mapId(value: number) {
+ pb_1.Message.setField(this, 2, value);
+ }
+ get ckmBoxId() {
+ return pb_1.Message.getFieldWithDefault(this, 3, 0) as number;
+ }
+ set ckmBoxId(value: number) {
+ pb_1.Message.setField(this, 3, value);
+ }
+ get buttonCode() {
+ return pb_1.Message.getFieldWithDefault(this, 4, "") as string;
+ }
+ set buttonCode(value: string) {
+ pb_1.Message.setField(this, 4, value);
+ }
+ get down() {
+ return pb_1.Message.getFieldWithDefault(this, 5, false) as boolean;
+ }
+ set down(value: boolean) {
+ pb_1.Message.setField(this, 5, value);
+ }
+ static fromObject(data: {
+ simulationId?: string;
+ mapId?: number;
+ ckmBoxId?: number;
+ buttonCode?: string;
+ down?: boolean;
+ }): CkmBoxOperationReq {
+ const message = new CkmBoxOperationReq({});
+ if (data.simulationId != null) {
+ message.simulationId = data.simulationId;
+ }
+ if (data.mapId != null) {
+ message.mapId = data.mapId;
+ }
+ if (data.ckmBoxId != null) {
+ message.ckmBoxId = data.ckmBoxId;
+ }
+ if (data.buttonCode != null) {
+ message.buttonCode = data.buttonCode;
+ }
+ if (data.down != null) {
+ message.down = data.down;
+ }
+ return message;
+ }
+ toObject() {
+ const data: {
+ simulationId?: string;
+ mapId?: number;
+ ckmBoxId?: number;
+ buttonCode?: string;
+ down?: boolean;
+ } = {};
+ if (this.simulationId != null) {
+ data.simulationId = this.simulationId;
+ }
+ if (this.mapId != null) {
+ data.mapId = this.mapId;
+ }
+ if (this.ckmBoxId != null) {
+ data.ckmBoxId = this.ckmBoxId;
+ }
+ if (this.buttonCode != null) {
+ data.buttonCode = this.buttonCode;
+ }
+ if (this.down != null) {
+ data.down = this.down;
+ }
+ return data;
+ }
+ serialize(): Uint8Array;
+ serialize(w: pb_1.BinaryWriter): void;
+ serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
+ const writer = w || new pb_1.BinaryWriter();
+ if (this.simulationId.length)
+ writer.writeString(1, this.simulationId);
+ if (this.mapId != 0)
+ writer.writeInt32(2, this.mapId);
+ if (this.ckmBoxId != 0)
+ writer.writeUint32(3, this.ckmBoxId);
+ if (this.buttonCode.length)
+ writer.writeString(4, this.buttonCode);
+ if (this.down != false)
+ writer.writeBool(5, this.down);
+ if (!w)
+ return writer.getResultBuffer();
+ }
+ static deserialize(bytes: Uint8Array | pb_1.BinaryReader): CkmBoxOperationReq {
+ const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new CkmBoxOperationReq();
+ while (reader.nextField()) {
+ if (reader.isEndGroup())
+ break;
+ switch (reader.getFieldNumber()) {
+ case 1:
+ message.simulationId = reader.readString();
+ break;
+ case 2:
+ message.mapId = reader.readInt32();
+ break;
+ case 3:
+ message.ckmBoxId = reader.readUint32();
+ break;
+ case 4:
+ message.buttonCode = reader.readString();
+ break;
+ case 5:
+ message.down = reader.readBool();
+ break;
+ default: reader.skipField();
+ }
+ }
+ return message;
+ }
+ serializeBinary(): Uint8Array {
+ return this.serialize();
+ }
+ static deserializeBinary(bytes: Uint8Array): CkmBoxOperationReq {
+ return CkmBoxOperationReq.deserialize(bytes);
+ }
+ }
}
diff --git a/src/protos/stationLayoutGraphics.ts b/src/protos/stationLayoutGraphics.ts
index 74a941d..764c18b 100644
--- a/src/protos/stationLayoutGraphics.ts
+++ b/src/protos/stationLayoutGraphics.ts
@@ -55,9 +55,10 @@ export namespace graphicData {
carWashings?: CarWashing[];
garageDoors?: GarageDoor[];
floodGates?: FloodGate[];
+ garageDoorBoxes?: GarageDoorBox[];
}) {
super();
- pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, 29, 32, 33, 34, 35, 37, 39, 40, 41, 42, 43, 44, 45, 46, 47], this.#one_of_decls);
+ pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, 29, 32, 33, 34, 35, 37, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") {
if ("canvas" in data && data.canvas != undefined) {
this.canvas = data.canvas;
@@ -185,6 +186,9 @@ export namespace graphicData {
if ("floodGates" in data && data.floodGates != undefined) {
this.floodGates = data.floodGates;
}
+ if ("garageDoorBoxes" in data && data.garageDoorBoxes != undefined) {
+ this.garageDoorBoxes = data.garageDoorBoxes;
+ }
}
}
get canvas() {
@@ -451,6 +455,12 @@ export namespace graphicData {
set floodGates(value: FloodGate[]) {
pb_1.Message.setRepeatedWrapperField(this, 47, value);
}
+ get garageDoorBoxes() {
+ return pb_1.Message.getRepeatedWrapperField(this, GarageDoorBox, 48) as GarageDoorBox[];
+ }
+ set garageDoorBoxes(value: GarageDoorBox[]) {
+ pb_1.Message.setRepeatedWrapperField(this, 48, value);
+ }
static fromObject(data: {
canvas?: ReturnType;
Platforms?: ReturnType[];
@@ -494,6 +504,7 @@ export namespace graphicData {
carWashings?: ReturnType[];
garageDoors?: ReturnType[];
floodGates?: ReturnType[];
+ garageDoorBoxes?: ReturnType[];
}): RtssGraphicStorage {
const message = new RtssGraphicStorage({});
if (data.canvas != null) {
@@ -622,6 +633,9 @@ export namespace graphicData {
if (data.floodGates != null) {
message.floodGates = data.floodGates.map(item => FloodGate.fromObject(item));
}
+ if (data.garageDoorBoxes != null) {
+ message.garageDoorBoxes = data.garageDoorBoxes.map(item => GarageDoorBox.fromObject(item));
+ }
return message;
}
toObject() {
@@ -668,6 +682,7 @@ export namespace graphicData {
carWashings?: ReturnType[];
garageDoors?: ReturnType[];
floodGates?: ReturnType[];
+ garageDoorBoxes?: ReturnType[];
} = {};
if (this.canvas != null) {
data.canvas = this.canvas.toObject();
@@ -795,6 +810,9 @@ export namespace graphicData {
if (this.floodGates != null) {
data.floodGates = this.floodGates.map((item: FloodGate) => item.toObject());
}
+ if (this.garageDoorBoxes != null) {
+ data.garageDoorBoxes = this.garageDoorBoxes.map((item: GarageDoorBox) => item.toObject());
+ }
return data;
}
serialize(): Uint8Array;
@@ -885,6 +903,8 @@ export namespace graphicData {
writer.writeRepeatedMessage(46, this.garageDoors, (item: GarageDoor) => item.serialize(writer));
if (this.floodGates.length)
writer.writeRepeatedMessage(47, this.floodGates, (item: FloodGate) => item.serialize(writer));
+ if (this.garageDoorBoxes.length)
+ writer.writeRepeatedMessage(48, this.garageDoorBoxes, (item: GarageDoorBox) => item.serialize(writer));
if (!w)
return writer.getResultBuffer();
}
@@ -1020,6 +1040,9 @@ export namespace graphicData {
case 47:
reader.readMessage(message.floodGates, () => pb_1.Message.addToRepeatedWrapperField(message, 47, FloodGate.deserialize(reader), FloodGate));
break;
+ case 48:
+ reader.readMessage(message.garageDoorBoxes, () => pb_1.Message.addToRepeatedWrapperField(message, 48, GarageDoorBox.deserialize(reader), GarageDoorBox));
+ break;
default: reader.skipField();
}
}
@@ -9837,6 +9860,7 @@ export namespace graphicData {
totalLength?: number;
trainSets?: string;
dynamicConfig?: dependency_1.common.TrainDynamicConfig;
+ trainControlMapId?: number;
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
@@ -9856,6 +9880,9 @@ export namespace graphicData {
if ("dynamicConfig" in data && data.dynamicConfig != undefined) {
this.dynamicConfig = data.dynamicConfig;
}
+ if ("trainControlMapId" in data && data.trainControlMapId != undefined) {
+ this.trainControlMapId = data.trainControlMapId;
+ }
}
}
get trainModel() {
@@ -9891,12 +9918,19 @@ export namespace graphicData {
get has_dynamicConfig() {
return pb_1.Message.getField(this, 7) != null;
}
+ get trainControlMapId() {
+ return pb_1.Message.getFieldWithDefault(this, 9, 0) as number;
+ }
+ set trainControlMapId(value: number) {
+ pb_1.Message.setField(this, 9, value);
+ }
static fromObject(data: {
trainModel?: Train.TrainModel;
carriageLength?: number;
totalLength?: number;
trainSets?: string;
dynamicConfig?: ReturnType;
+ trainControlMapId?: number;
}): Train {
const message = new Train({});
if (data.trainModel != null) {
@@ -9914,6 +9948,9 @@ export namespace graphicData {
if (data.dynamicConfig != null) {
message.dynamicConfig = dependency_1.common.TrainDynamicConfig.fromObject(data.dynamicConfig);
}
+ if (data.trainControlMapId != null) {
+ message.trainControlMapId = data.trainControlMapId;
+ }
return message;
}
toObject() {
@@ -9923,6 +9960,7 @@ export namespace graphicData {
totalLength?: number;
trainSets?: string;
dynamicConfig?: ReturnType;
+ trainControlMapId?: number;
} = {};
if (this.trainModel != null) {
data.trainModel = this.trainModel;
@@ -9939,6 +9977,9 @@ export namespace graphicData {
if (this.dynamicConfig != null) {
data.dynamicConfig = this.dynamicConfig.toObject();
}
+ if (this.trainControlMapId != null) {
+ data.trainControlMapId = this.trainControlMapId;
+ }
return data;
}
serialize(): Uint8Array;
@@ -9955,6 +9996,8 @@ export namespace graphicData {
writer.writeString(6, this.trainSets);
if (this.has_dynamicConfig)
writer.writeMessage(7, this.dynamicConfig, () => this.dynamicConfig.serialize(writer));
+ if (this.trainControlMapId != 0)
+ writer.writeInt32(9, this.trainControlMapId);
if (!w)
return writer.getResultBuffer();
}
@@ -9979,6 +10022,9 @@ export namespace graphicData {
case 7:
reader.readMessage(message.dynamicConfig, () => message.dynamicConfig = dependency_1.common.TrainDynamicConfig.deserialize(reader));
break;
+ case 9:
+ message.trainControlMapId = reader.readInt32();
+ break;
default: reader.skipField();
}
}
@@ -10112,4 +10158,166 @@ export namespace graphicData {
return OtherLine.deserialize(bytes);
}
}
+ export class GarageDoorBox extends pb_1.Message {
+ #one_of_decls: number[][] = [];
+ constructor(data?: any[] | {
+ common?: CommonInfo;
+ code?: string;
+ refPslMapCode?: string;
+ refGarageDoorId?: number;
+ flip?: boolean;
+ }) {
+ super();
+ pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
+ if (!Array.isArray(data) && typeof data == "object") {
+ if ("common" in data && data.common != undefined) {
+ this.common = data.common;
+ }
+ if ("code" in data && data.code != undefined) {
+ this.code = data.code;
+ }
+ if ("refPslMapCode" in data && data.refPslMapCode != undefined) {
+ this.refPslMapCode = data.refPslMapCode;
+ }
+ if ("refGarageDoorId" in data && data.refGarageDoorId != undefined) {
+ this.refGarageDoorId = data.refGarageDoorId;
+ }
+ if ("flip" in data && data.flip != undefined) {
+ this.flip = data.flip;
+ }
+ }
+ }
+ get common() {
+ return pb_1.Message.getWrapperField(this, CommonInfo, 1) as CommonInfo;
+ }
+ set common(value: CommonInfo) {
+ pb_1.Message.setWrapperField(this, 1, value);
+ }
+ get has_common() {
+ return pb_1.Message.getField(this, 1) != null;
+ }
+ get code() {
+ return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
+ }
+ set code(value: string) {
+ pb_1.Message.setField(this, 2, value);
+ }
+ get refPslMapCode() {
+ return pb_1.Message.getFieldWithDefault(this, 3, "") as string;
+ }
+ set refPslMapCode(value: string) {
+ pb_1.Message.setField(this, 3, value);
+ }
+ get refGarageDoorId() {
+ return pb_1.Message.getFieldWithDefault(this, 4, 0) as number;
+ }
+ set refGarageDoorId(value: number) {
+ pb_1.Message.setField(this, 4, value);
+ }
+ get flip() {
+ return pb_1.Message.getFieldWithDefault(this, 5, false) as boolean;
+ }
+ set flip(value: boolean) {
+ pb_1.Message.setField(this, 5, value);
+ }
+ static fromObject(data: {
+ common?: ReturnType;
+ code?: string;
+ refPslMapCode?: string;
+ refGarageDoorId?: number;
+ flip?: boolean;
+ }): GarageDoorBox {
+ const message = new GarageDoorBox({});
+ if (data.common != null) {
+ message.common = CommonInfo.fromObject(data.common);
+ }
+ if (data.code != null) {
+ message.code = data.code;
+ }
+ if (data.refPslMapCode != null) {
+ message.refPslMapCode = data.refPslMapCode;
+ }
+ if (data.refGarageDoorId != null) {
+ message.refGarageDoorId = data.refGarageDoorId;
+ }
+ if (data.flip != null) {
+ message.flip = data.flip;
+ }
+ return message;
+ }
+ toObject() {
+ const data: {
+ common?: ReturnType;
+ code?: string;
+ refPslMapCode?: string;
+ refGarageDoorId?: number;
+ flip?: boolean;
+ } = {};
+ if (this.common != null) {
+ data.common = this.common.toObject();
+ }
+ if (this.code != null) {
+ data.code = this.code;
+ }
+ if (this.refPslMapCode != null) {
+ data.refPslMapCode = this.refPslMapCode;
+ }
+ if (this.refGarageDoorId != null) {
+ data.refGarageDoorId = this.refGarageDoorId;
+ }
+ if (this.flip != null) {
+ data.flip = this.flip;
+ }
+ return data;
+ }
+ serialize(): Uint8Array;
+ serialize(w: pb_1.BinaryWriter): void;
+ serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
+ const writer = w || new pb_1.BinaryWriter();
+ if (this.has_common)
+ writer.writeMessage(1, this.common, () => this.common.serialize(writer));
+ if (this.code.length)
+ writer.writeString(2, this.code);
+ if (this.refPslMapCode.length)
+ writer.writeString(3, this.refPslMapCode);
+ if (this.refGarageDoorId != 0)
+ writer.writeUint32(4, this.refGarageDoorId);
+ if (this.flip != false)
+ writer.writeBool(5, this.flip);
+ if (!w)
+ return writer.getResultBuffer();
+ }
+ static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GarageDoorBox {
+ const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GarageDoorBox();
+ while (reader.nextField()) {
+ if (reader.isEndGroup())
+ break;
+ switch (reader.getFieldNumber()) {
+ case 1:
+ reader.readMessage(message.common, () => message.common = CommonInfo.deserialize(reader));
+ break;
+ case 2:
+ message.code = reader.readString();
+ break;
+ case 3:
+ message.refPslMapCode = reader.readString();
+ break;
+ case 4:
+ message.refGarageDoorId = reader.readUint32();
+ break;
+ case 5:
+ message.flip = reader.readBool();
+ break;
+ default: reader.skipField();
+ }
+ }
+ return message;
+ }
+ serializeBinary(): Uint8Array {
+ return this.serialize();
+ }
+ static deserializeBinary(bytes: Uint8Array): GarageDoorBox {
+ return GarageDoorBox.deserialize(bytes);
+ }
+ }
}