From f6a2456ccb2e8dd50816c538b84eb587a90e7bf1 Mon Sep 17 00:00:00 2001
From: dong <58670809@qq.com>
Date: Thu, 16 Nov 2023 18:06:59 +0800
Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=8A=98=E8=BF=94=E6=8C=89?=
=?UTF-8?q?=E9=92=AE=E7=AE=B1?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/drawIcon.svg | 7 +
src/components/draw-app/DrawProperties.vue | 5 +
.../properties/AutoReturnBoxProperty.vue | 63 +++
.../graphics/AutoReturnBoxInteraction.ts | 199 ++++++++
src/drawApp/zdwxApp.ts | 25 +-
src/graphics/autoReturnBox/AutoReturnBox.ts | 137 ++++++
.../AutoReturnBoxDrawAssistant.ts | 148 ++++++
src/layouts/DrawLayout.vue | 2 +
src/protos/stationLayoutGraphics.ts | 423 +++++++++++++++++-
9 files changed, 1007 insertions(+), 2 deletions(-)
create mode 100644 src/components/draw-app/properties/AutoReturnBoxProperty.vue
create mode 100644 src/drawApp/graphics/AutoReturnBoxInteraction.ts
create mode 100644 src/graphics/autoReturnBox/AutoReturnBox.ts
create mode 100644 src/graphics/autoReturnBox/AutoReturnBoxDrawAssistant.ts
diff --git a/public/drawIcon.svg b/public/drawIcon.svg
index 65df2f8..5945578 100644
--- a/public/drawIcon.svg
+++ b/public/drawIcon.svg
@@ -68,4 +68,11 @@
+
+
+
+
+
+
+
diff --git a/src/components/draw-app/DrawProperties.vue b/src/components/draw-app/DrawProperties.vue
index 001bf9e..5970554 100644
--- a/src/components/draw-app/DrawProperties.vue
+++ b/src/components/draw-app/DrawProperties.vue
@@ -95,6 +95,9 @@
+
@@ -174,6 +177,8 @@ import GatedBoxProperty from './properties/GatedBoxProperty.vue';
import { GatedBox } from 'src/graphics/gatedBox/GatedBox';
import EsbButtonProperty from './properties/EsbButtonProperty.vue';
import { EsbButton } from 'src/graphics/esbButton/EsbButton';
+import AutoReturnBoxProperty from './properties/AutoReturnBoxProperty.vue';
+import { AutoReturnBox } from 'src/graphics/autoReturnBox/AutoReturnBox';
import SlopeKiloMarkerProperty from './properties/SlopeKiloMarkerProperty.vue';
import CurvatureKiloMarkerProperty from './properties/CurvatureKiloMarkerProperty.vue';
import { SlopeKiloMarker } from 'src/graphics/slopeKiloMarker/SlopeKiloMarker';
diff --git a/src/components/draw-app/properties/AutoReturnBoxProperty.vue b/src/components/draw-app/properties/AutoReturnBoxProperty.vue
new file mode 100644
index 0000000..40f1061
--- /dev/null
+++ b/src/components/draw-app/properties/AutoReturnBoxProperty.vue
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/src/drawApp/graphics/AutoReturnBoxInteraction.ts b/src/drawApp/graphics/AutoReturnBoxInteraction.ts
new file mode 100644
index 0000000..a5c81f1
--- /dev/null
+++ b/src/drawApp/graphics/AutoReturnBoxInteraction.ts
@@ -0,0 +1,199 @@
+import * as pb_1 from 'google-protobuf';
+import { DisplayObject, FederatedMouseEvent } from 'pixi.js';
+import {
+ IGraphicApp,
+ GraphicInteractionPlugin,
+ JlGraphic,
+ IGraphicScene,
+} from 'src/jl-graphic';
+import { ContextMenu } from 'src/jl-graphic/ui/ContextMenu';
+import { MenuItemOptions } from 'src/jl-graphic/ui/Menu';
+
+import { graphicData } from 'src/protos/stationLayoutGraphics';
+import { GraphicDataBase, GraphicStateBase } from './GraphicDataBase';
+import { useLineStore } from 'src/stores/line-store';
+import { state } from 'src/protos/device_state';
+import {
+ AutoReturnBox,
+ IAutoReturnBoxData,
+ IAutoReturnBoxState,
+} from 'src/graphics/autoReturnBox/AutoReturnBox';
+
+export class AutoReturnBoxData
+ extends GraphicDataBase
+ implements IAutoReturnBoxData
+{
+ constructor(data?: graphicData.AutoReturnBox) {
+ let autoReturnBox;
+ if (!data) {
+ autoReturnBox = new graphicData.AutoReturnBox({
+ common: GraphicDataBase.defaultCommonInfo(AutoReturnBox.Type),
+ });
+ } else {
+ autoReturnBox = data;
+ }
+ super(autoReturnBox);
+ }
+
+ public get data(): graphicData.AutoReturnBox {
+ 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 index(): number {
+ return this.data.index;
+ }
+ set index(v: number) {
+ this.data.index = v;
+ }
+ get refStand(): string {
+ return this.data.refStand;
+ }
+ set refStand(v: string) {
+ this.data.refStand = v;
+ }
+ clone(): AutoReturnBoxData {
+ return new AutoReturnBoxData(this.data.cloneMessage());
+ }
+ copyFrom(data: AutoReturnBoxData): void {
+ pb_1.Message.copyInto(data.data, this.data);
+ }
+ eq(other: AutoReturnBoxData): boolean {
+ return pb_1.Message.equals(this.data, other.data);
+ }
+}
+
+export class AutoReturnBoxState
+ extends GraphicStateBase
+ implements IAutoReturnBoxState
+{
+ constructor(data?: state.ButtonState) {
+ let ibpButtonState;
+ if (data) {
+ ibpButtonState = data;
+ } else {
+ ibpButtonState = new state.ButtonState();
+ }
+ super(ibpButtonState, AutoReturnBox.Type);
+ }
+ get states(): state.ButtonState {
+ return this.getState();
+ }
+ get code(): string {
+ return this.states.id;
+ }
+ get id(): string {
+ return this.states.id;
+ }
+ set id(v: string) {
+ this.states.id = v;
+ }
+ get down(): boolean {
+ return this.states.down;
+ }
+ set down(v: boolean) {
+ this.states.down = v;
+ }
+ clone(): AutoReturnBoxState {
+ return new AutoReturnBoxState(this.states.cloneMessage());
+ }
+ copyFrom(data: GraphicStateBase): void {
+ pb_1.Message.copyInto(data._state, this._state);
+ }
+ eq(data: GraphicStateBase): boolean {
+ return pb_1.Message.equals(this._state, data._state);
+ }
+}
+
+const flipConfig: MenuItemOptions = {
+ name: '上下翻转',
+};
+const AutoReturnBoxEditMenu: ContextMenu = ContextMenu.init({
+ name: '自动折返按钮箱编辑菜单',
+ groups: [
+ {
+ items: [flipConfig],
+ },
+ ],
+});
+export class DrawAutoReturnBoxInteraction extends GraphicInteractionPlugin {
+ static Name = 'autoreturn_box_draw_right_menu';
+ constructor(app: IGraphicApp) {
+ super(DrawAutoReturnBoxInteraction.Name, app);
+ app.registerMenu(AutoReturnBoxEditMenu);
+ }
+ static init(app: IGraphicApp) {
+ return new DrawAutoReturnBoxInteraction(app);
+ }
+ filter(...grahpics: JlGraphic[]): AutoReturnBox[] | undefined {
+ return grahpics
+ .filter((g) => g.type === AutoReturnBox.Type)
+ .map((g) => g as AutoReturnBox);
+ }
+ bind(g: AutoReturnBox): void {
+ g.on('_rightclick', this.onContextMenu, this);
+ }
+
+ unbind(g: AutoReturnBox): void {
+ g.off('_rightclick', this.onContextMenu, this);
+ }
+
+ onContextMenu(e: FederatedMouseEvent) {
+ const target = e.target as DisplayObject;
+ const autoReturnBox = target.getGraphic() as AutoReturnBox;
+ this.app.updateSelected(autoReturnBox);
+ flipConfig.handler = () => {
+ autoReturnBox.datas.flip = !autoReturnBox.datas.flip;
+ console.log(autoReturnBox.datas, 'data');
+ autoReturnBox.repaint();
+ };
+ AutoReturnBoxEditMenu.open(e.global);
+ }
+}
+
+export class AutoReturnBoxOperationInteraction extends GraphicInteractionPlugin {
+ static Name = 'autoreturn_box_operation';
+ constructor(scene: IGraphicScene) {
+ super(AutoReturnBoxOperationInteraction.Name, scene);
+ }
+ static init(scene: IGraphicScene) {
+ return new AutoReturnBoxOperationInteraction(scene);
+ }
+ filter(...grahpics: JlGraphic[]): AutoReturnBox[] | undefined {
+ return grahpics.filter(
+ (g): g is AutoReturnBox => g.type === AutoReturnBox.Type
+ );
+ }
+ bind(g: AutoReturnBox): void {
+ g.eventMode = 'static';
+ g.cursor = 'pointer';
+ g.on('mousedown', this.onPress, this);
+ }
+ unbind(g: AutoReturnBox): void {
+ g.eventMode = 'none';
+ g.cursor = 'default';
+ g.off('mousedown', this.onPress, this);
+ }
+ onPress(e: FederatedMouseEvent) {
+ const g = e.target as AutoReturnBox;
+ g.on('mouseleave', this.onRelease, this);
+ g.on('mouseup', this.onRelease, this);
+ useLineStore().esbButtonOperation(true, g.datas.id);
+ }
+ onRelease(e: FederatedMouseEvent) {
+ const g = e.target as AutoReturnBox;
+ g.off('mouseleave', this.onRelease, this);
+ g.off('mouseup', this.onRelease, this);
+ useLineStore().esbButtonOperation(false, g.datas.id);
+ }
+}
diff --git a/src/drawApp/zdwxApp.ts b/src/drawApp/zdwxApp.ts
index 3fc196f..bf07b5b 100644
--- a/src/drawApp/zdwxApp.ts
+++ b/src/drawApp/zdwxApp.ts
@@ -53,7 +53,16 @@ import {
} from 'src/graphics/departureTimer/DepartureTimer';
import { DepartureTimerData } from './graphics/DepartureTimerInteraction';
import { DepartureTimerDraw } from 'src/graphics/departureTimer/DepartureTimerDrawAssistant';
-
+import { AutoReturnBoxDraw } from 'src/graphics/autoReturnBox/AutoReturnBoxDrawAssistant';
+import {
+ AutoReturnBox,
+ AutoReturnBoxTemplate,
+} from 'src/graphics/autoReturnBox/AutoReturnBox';
+import {
+ AutoReturnBoxData,
+ DrawAutoReturnBoxInteraction,
+ AutoReturnBoxState,
+} from './graphics/AutoReturnBoxInteraction';
let zdwxDrawApp: IDrawApp | null = null;
export function getZdwxDrawApp(): IDrawApp | null {
@@ -74,6 +83,7 @@ export const drawZdwxLayerList = [
{ label: '轨道逻辑区段', value: TrackLogicSection.Type, defaultShow: false },
{ label: '信标', value: Beacon.Type, defaultShow: true },
{ label: '发车计时器', value: DepartureTimer.Type, defaultShow: true },
+ { label: '自动折返按钮箱', value: AutoReturnBox.Type, defaultShow: true },
];
function initZdwxShowLayer(app: IDrawApp) {
@@ -124,8 +134,13 @@ export function initZdwxDrawApp(): IDrawApp {
app,
new ZdwxEsbTemplate(new ZdwxEsbData(), new ZdwxEsbState())
);
+ new AutoReturnBoxDraw(
+ app,
+ new AutoReturnBoxTemplate(new AutoReturnBoxData(), new AutoReturnBoxState())
+ );
DrawBeaconInteraction.init(app);
DrawZdwxEsbInteraction.init(app);
+ DrawAutoReturnBoxInteraction.init(app);
app.addKeyboardListener(
new KeyListener({
value: 'KeyS',
@@ -169,6 +184,9 @@ export async function loadZdwxDrawDatas(): Promise {
storage.departureTimers.forEach((departureTimer) => {
datas.push(new DepartureTimerData(departureTimer));
});
+ storage.autoReturnBoxs.forEach((autoReturnBox) => {
+ datas.push(new AutoReturnBoxData(autoReturnBox));
+ });
refDevicesList = storage.stationRelateDeviceList;
return Promise.resolve({
canvasProperty: storage.canvas,
@@ -205,6 +223,11 @@ export function saveZdwxDrawDatas(app: IDrawApp) {
storage.departureTimers.push(
(departureTimerData as DepartureTimerData).data
);
+ } else if (AutoReturnBox.Type === g.type) {
+ const autoReturnBoxData = (g as AutoReturnBox).saveData();
+ storage.autoReturnBoxs.push(
+ (autoReturnBoxData as AutoReturnBoxData).data
+ );
}
});
const base64 = fromUint8Array(storage.serialize());
diff --git a/src/graphics/autoReturnBox/AutoReturnBox.ts b/src/graphics/autoReturnBox/AutoReturnBox.ts
new file mode 100644
index 0000000..bfb8a5c
--- /dev/null
+++ b/src/graphics/autoReturnBox/AutoReturnBox.ts
@@ -0,0 +1,137 @@
+import { Graphics } from 'pixi.js';
+import {
+ GraphicData,
+ GraphicState,
+ JlGraphic,
+ JlGraphicTemplate,
+ VectorText,
+} from 'src/jl-graphic';
+
+export interface IAutoReturnBoxData extends GraphicData {
+ get code(): string;
+ set code(v: string);
+ get flip(): boolean;
+ set flip(v: boolean);
+ get index(): number;
+ set index(v: number);
+ get refStand(): string;
+ set refStand(v: string);
+ clone(): IAutoReturnBoxData;
+ copyFrom(data: IAutoReturnBoxData): void;
+ eq(other: IAutoReturnBoxData): boolean;
+}
+
+export interface IAutoReturnBoxState extends GraphicState {
+ id: string;
+ get down(): boolean;
+ set down(v: boolean);
+}
+
+const autoReturnBoxConsts = {
+ codeFontSize: 12,
+ codeColor: 0xffffff,
+ bodyLineColor: 0x16db34,
+ lineWidth: 1,
+ TlineWidth: 4,
+ bodyRectWidth: 25,
+ bodyCircleRadius: 6,
+};
+export class AutoReturnBox extends JlGraphic {
+ static Type = 'autoReturnBox';
+ codeGraph: VectorText = new VectorText('');
+ circleBody: Graphics = new Graphics();
+
+ constructor() {
+ super(AutoReturnBox.Type);
+ this.addChild(this.codeGraph);
+ this.addChild(this.circleBody);
+ this.codeGraph.name = 'atb_code';
+ }
+ get datas(): IAutoReturnBoxData {
+ return this.getDatas();
+ }
+ get state(): IAutoReturnBoxState {
+ return this.getStates();
+ }
+ get code(): string {
+ return this.datas.index + '';
+ }
+ doRepaint(): void {
+ const codeGraph = this.codeGraph;
+ codeGraph.text = this.datas.code;
+ codeGraph.style.fill = autoReturnBoxConsts.codeColor;
+ codeGraph.setVectorFontSize(autoReturnBoxConsts.codeFontSize);
+ codeGraph.anchor.set(0.5);
+ const codeTransform = this.datas?.childTransforms?.find(
+ (item) => item.name === 'atb_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(-30, 0);
+ }
+ this.circleBody.clear();
+ this.circleBody.lineStyle(
+ autoReturnBoxConsts.lineWidth,
+ autoReturnBoxConsts.bodyLineColor
+ );
+ this.circleBody.drawRect(
+ -autoReturnBoxConsts.bodyRectWidth / 2,
+ -autoReturnBoxConsts.bodyRectWidth / 2,
+ autoReturnBoxConsts.bodyRectWidth,
+ autoReturnBoxConsts.bodyRectWidth
+ );
+ this.circleBody.drawCircle(0, 0, autoReturnBoxConsts.bodyRectWidth / 2);
+ if (this.datas.flip) {
+ this.circleBody.arc(
+ 0,
+ 0,
+ autoReturnBoxConsts.bodyCircleRadius,
+ 0,
+ Math.PI
+ );
+ this.circleBody.lineStyle(
+ autoReturnBoxConsts.TlineWidth,
+ autoReturnBoxConsts.bodyLineColor
+ );
+ this.circleBody.moveTo(0, 0);
+ this.circleBody.lineTo(0, -8);
+ this.circleBody.moveTo(-6, 0);
+ this.circleBody.lineTo(6, 0);
+ } else {
+ this.circleBody.arc(
+ 0,
+ 0,
+ autoReturnBoxConsts.bodyCircleRadius,
+ Math.PI,
+ 0
+ );
+ this.circleBody.lineStyle(
+ autoReturnBoxConsts.TlineWidth,
+ autoReturnBoxConsts.bodyLineColor
+ );
+ this.circleBody.moveTo(0, 0);
+ this.circleBody.lineTo(0, 8);
+ this.circleBody.moveTo(-6, 0);
+ this.circleBody.lineTo(6, 0);
+ }
+ }
+}
+
+export class AutoReturnBoxTemplate extends JlGraphicTemplate {
+ constructor(
+ dataTemplate: IAutoReturnBoxData,
+ stateTemplate?: IAutoReturnBoxState
+ ) {
+ super(AutoReturnBox.Type, { dataTemplate, stateTemplate });
+ }
+ new(): AutoReturnBox {
+ const autoReturnBox = new AutoReturnBox();
+ autoReturnBox.loadData(this.datas);
+ autoReturnBox.loadState(this.states);
+ return autoReturnBox;
+ }
+}
diff --git a/src/graphics/autoReturnBox/AutoReturnBoxDrawAssistant.ts b/src/graphics/autoReturnBox/AutoReturnBoxDrawAssistant.ts
new file mode 100644
index 0000000..3c1e26b
--- /dev/null
+++ b/src/graphics/autoReturnBox/AutoReturnBoxDrawAssistant.ts
@@ -0,0 +1,148 @@
+import { DisplayObject, FederatedMouseEvent, IHitArea, Point } from 'pixi.js';
+import {
+ AbsorbableLine,
+ AbsorbablePosition,
+ GraphicDrawAssistant,
+ GraphicInteractionPlugin,
+ GraphicTransformEvent,
+ IDrawApp,
+ JlGraphic,
+ pointBox,
+} from 'src/jl-graphic';
+import {
+ AutoReturnBox,
+ AutoReturnBoxTemplate,
+ IAutoReturnBoxData,
+} from './AutoReturnBox';
+
+export interface IEsbButtonDataDrawOptions {
+ newData: () => IAutoReturnBoxData;
+}
+export class AutoReturnBoxDraw extends GraphicDrawAssistant<
+ AutoReturnBoxTemplate,
+ IAutoReturnBoxData
+> {
+ _autoReturnBox: AutoReturnBox | null = null;
+ constructor(app: IDrawApp, template: AutoReturnBoxTemplate) {
+ super(
+ app,
+ template,
+ 'svguse:../../drawIcon.svg#icon-autoreturn-box',
+ '自动折返按钮箱AutoReturnBox'
+ );
+ AutoReturnBoxInteraction.init(app);
+ }
+ public get autoReturnBox(): AutoReturnBox {
+ if (!this._autoReturnBox) {
+ this._autoReturnBox = this.graphicTemplate.new();
+ this._autoReturnBox.loadData(this.graphicTemplate.datas);
+ this.container.addChild(this._autoReturnBox);
+ }
+ return this._autoReturnBox;
+ }
+
+ onLeftUp(e: FederatedMouseEvent): void {
+ this.container.position.copyFrom(this.toCanvasCoordinates(e.global));
+ this.createAndStore(true);
+ }
+
+ redraw(p: Point): void {
+ this.autoReturnBox.repaint();
+ this.container.position.set(p.x, p.y);
+ }
+
+ prepareData(data: IAutoReturnBoxData): boolean {
+ data.transform = this.container.saveTransform();
+ data.code = 'ATB';
+ return true;
+ }
+}
+/**
+ * 构建吸附线
+ * @param autoReturnBox
+ */
+function buildAbsorbablePositions(
+ autoReturnBox: AutoReturnBox
+): AbsorbablePosition[] {
+ const aps: AbsorbablePosition[] = [];
+ const esbButtons = autoReturnBox.queryStore.queryByType(
+ AutoReturnBox.Type
+ );
+ const canvas = autoReturnBox.getCanvas();
+ esbButtons.forEach((item) => {
+ if (item.id === autoReturnBox.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 AtbBodyHitArea implements IHitArea {
+ autoReturnBox: AutoReturnBox;
+ constructor(autoReturnBox: AutoReturnBox) {
+ this.autoReturnBox = autoReturnBox;
+ }
+ contains(x: number, y: number): boolean {
+ let contains = false;
+ const p = new Point(x, y);
+ const r = this.autoReturnBox.getLocalBounds();
+ contains = pointBox(p, r);
+ return contains;
+ }
+}
+
+export class AutoReturnBoxInteraction extends GraphicInteractionPlugin {
+ static Name = 'autoReturn_box_transform';
+ constructor(app: IDrawApp) {
+ super(AutoReturnBoxInteraction.Name, app);
+ }
+ static init(app: IDrawApp) {
+ return new AutoReturnBoxInteraction(app);
+ }
+ filter(...grahpics: JlGraphic[]): AutoReturnBox[] | undefined {
+ return grahpics
+ .filter((g) => g.type === AutoReturnBox.Type)
+ .map((g) => g as AutoReturnBox);
+ }
+ bind(g: AutoReturnBox): 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.circleBody.hitArea = new AtbBodyHitArea(g);
+ g.on('transformstart', this.transformstart, this);
+ }
+ unbind(g: AutoReturnBox): 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 autoReturnBox = target.getGraphic() as AutoReturnBox;
+ autoReturnBox.getGraphicApp().setOptions({
+ absorbablePositions: buildAbsorbablePositions(autoReturnBox),
+ });
+ }
+}
diff --git a/src/layouts/DrawLayout.vue b/src/layouts/DrawLayout.vue
index ba4eba9..fa9325e 100644
--- a/src/layouts/DrawLayout.vue
+++ b/src/layouts/DrawLayout.vue
@@ -307,6 +307,7 @@ import AxleCountingConfig from 'src/components/draw-app/properties/AxleCountingC
import { PictureType } from 'src/protos/picture';
import { Beacon } from 'src/graphics/beacon/Beacon';
import { DepartureTimer } from 'src/graphics/departureTimer/DepartureTimer';
+import { AutoReturnBox } from 'src/graphics/autoReturnBox/AutoReturnBox';
const $q = useQuasar();
const route = useRoute();
@@ -463,6 +464,7 @@ onMounted(() => {
case CategoryType.ZDWX:
drawAssistantsTypes.push(Beacon.Type);
drawAssistantsTypes.push(DepartureTimer.Type);
+ drawAssistantsTypes.push(AutoReturnBox.Type);
break;
}
drawAssistantsTypes.forEach((type) => {
diff --git a/src/protos/stationLayoutGraphics.ts b/src/protos/stationLayoutGraphics.ts
index 1e49476..d892a52 100644
--- a/src/protos/stationLayoutGraphics.ts
+++ b/src/protos/stationLayoutGraphics.ts
@@ -45,9 +45,10 @@ export namespace graphicData {
beacons?: Beacon[];
generateAxleCountingConfig?: GenerateAxleCountingConfig;
departureTimers?: DepartureTimer[];
+ autoReturnBoxs?: AutoReturnBox[];
}) {
super();
- pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [4, 5, 8, 9, 10, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 32, 33, 34, 35, 37, 39], this.#one_of_decls);
+ pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [4, 5, 8, 9, 10, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 32, 33, 34, 35, 37, 39, 40], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") {
if ("canvas" in data && data.canvas != undefined) {
this.canvas = data.canvas;
@@ -148,6 +149,9 @@ export namespace graphicData {
if ("departureTimers" in data && data.departureTimers != undefined) {
this.departureTimers = data.departureTimers;
}
+ if ("autoReturnBoxs" in data && data.autoReturnBoxs != undefined) {
+ this.autoReturnBoxs = data.autoReturnBoxs;
+ }
}
}
get canvas() {
@@ -360,6 +364,12 @@ export namespace graphicData {
set departureTimers(value: DepartureTimer[]) {
pb_1.Message.setRepeatedWrapperField(this, 39, value);
}
+ get autoReturnBoxs() {
+ return pb_1.Message.getRepeatedWrapperField(this, AutoReturnBox, 40) as AutoReturnBox[];
+ }
+ set autoReturnBoxs(value: AutoReturnBox[]) {
+ pb_1.Message.setRepeatedWrapperField(this, 40, value);
+ }
static fromObject(data: {
canvas?: ReturnType;
Platforms?: ReturnType[];
@@ -394,6 +404,7 @@ export namespace graphicData {
beacons?: ReturnType[];
generateAxleCountingConfig?: ReturnType;
departureTimers?: ReturnType[];
+ autoReturnBoxs?: ReturnType[];
}): RtssGraphicStorage {
const message = new RtssGraphicStorage({});
if (data.canvas != null) {
@@ -495,6 +506,9 @@ export namespace graphicData {
if (data.departureTimers != null) {
message.departureTimers = data.departureTimers.map(item => DepartureTimer.fromObject(item));
}
+ if (data.autoReturnBoxs != null) {
+ message.autoReturnBoxs = data.autoReturnBoxs.map(item => AutoReturnBox.fromObject(item));
+ }
return message;
}
toObject() {
@@ -532,6 +546,7 @@ export namespace graphicData {
beacons?: ReturnType[];
generateAxleCountingConfig?: ReturnType;
departureTimers?: ReturnType[];
+ autoReturnBoxs?: ReturnType[];
} = {};
if (this.canvas != null) {
data.canvas = this.canvas.toObject();
@@ -632,6 +647,9 @@ export namespace graphicData {
if (this.departureTimers != null) {
data.departureTimers = this.departureTimers.map((item: DepartureTimer) => item.toObject());
}
+ if (this.autoReturnBoxs != null) {
+ data.autoReturnBoxs = this.autoReturnBoxs.map((item: AutoReturnBox) => item.toObject());
+ }
return data;
}
serialize(): Uint8Array;
@@ -704,6 +722,8 @@ export namespace graphicData {
writer.writeMessage(38, this.generateAxleCountingConfig, () => this.generateAxleCountingConfig.serialize(writer));
if (this.departureTimers.length)
writer.writeRepeatedMessage(39, this.departureTimers, (item: DepartureTimer) => item.serialize(writer));
+ if (this.autoReturnBoxs.length)
+ writer.writeRepeatedMessage(40, this.autoReturnBoxs, (item: AutoReturnBox) => item.serialize(writer));
if (!w)
return writer.getResultBuffer();
}
@@ -812,6 +832,9 @@ export namespace graphicData {
case 39:
reader.readMessage(message.departureTimers, () => pb_1.Message.addToRepeatedWrapperField(message, 39, DepartureTimer.deserialize(reader), DepartureTimer));
break;
+ case 40:
+ reader.readMessage(message.autoReturnBoxs, () => pb_1.Message.addToRepeatedWrapperField(message, 40, AutoReturnBox.deserialize(reader), AutoReturnBox));
+ break;
default: reader.skipField();
}
}
@@ -1921,6 +1944,8 @@ export namespace graphicData {
index?: number;
refIbpMapCode?: string;
stationName?: string;
+ stationNameAcronym?: string;
+ depots?: boolean;
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
@@ -1946,6 +1971,12 @@ export namespace graphicData {
if ("stationName" in data && data.stationName != undefined) {
this.stationName = data.stationName;
}
+ if ("stationNameAcronym" in data && data.stationNameAcronym != undefined) {
+ this.stationNameAcronym = data.stationNameAcronym;
+ }
+ if ("depots" in data && data.depots != undefined) {
+ this.depots = data.depots;
+ }
}
}
get common() {
@@ -1996,6 +2027,18 @@ export namespace graphicData {
set stationName(value: string) {
pb_1.Message.setField(this, 9, value);
}
+ get stationNameAcronym() {
+ return pb_1.Message.getFieldWithDefault(this, 10, "") as string;
+ }
+ set stationNameAcronym(value: string) {
+ pb_1.Message.setField(this, 10, value);
+ }
+ get depots() {
+ return pb_1.Message.getFieldWithDefault(this, 11, false) as boolean;
+ }
+ set depots(value: boolean) {
+ pb_1.Message.setField(this, 11, value);
+ }
static fromObject(data: {
common?: ReturnType;
code?: string;
@@ -2004,6 +2047,8 @@ export namespace graphicData {
index?: number;
refIbpMapCode?: string;
stationName?: string;
+ stationNameAcronym?: string;
+ depots?: boolean;
}): Station {
const message = new Station({});
if (data.common != null) {
@@ -2027,6 +2072,12 @@ export namespace graphicData {
if (data.stationName != null) {
message.stationName = data.stationName;
}
+ if (data.stationNameAcronym != null) {
+ message.stationNameAcronym = data.stationNameAcronym;
+ }
+ if (data.depots != null) {
+ message.depots = data.depots;
+ }
return message;
}
toObject() {
@@ -2038,6 +2089,8 @@ export namespace graphicData {
index?: number;
refIbpMapCode?: string;
stationName?: string;
+ stationNameAcronym?: string;
+ depots?: boolean;
} = {};
if (this.common != null) {
data.common = this.common.toObject();
@@ -2060,6 +2113,12 @@ export namespace graphicData {
if (this.stationName != null) {
data.stationName = this.stationName;
}
+ if (this.stationNameAcronym != null) {
+ data.stationNameAcronym = this.stationNameAcronym;
+ }
+ if (this.depots != null) {
+ data.depots = this.depots;
+ }
return data;
}
serialize(): Uint8Array;
@@ -2080,6 +2139,10 @@ export namespace graphicData {
writer.writeString(8, this.refIbpMapCode);
if (this.stationName.length)
writer.writeString(9, this.stationName);
+ if (this.stationNameAcronym.length)
+ writer.writeString(10, this.stationNameAcronym);
+ if (this.depots != false)
+ writer.writeBool(11, this.depots);
if (!w)
return writer.getResultBuffer();
}
@@ -2110,6 +2173,12 @@ export namespace graphicData {
case 9:
message.stationName = reader.readString();
break;
+ case 10:
+ message.stationNameAcronym = reader.readString();
+ break;
+ case 11:
+ message.depots = reader.readBool();
+ break;
default: reader.skipField();
}
}
@@ -7216,6 +7285,168 @@ export namespace graphicData {
return DepartureTimer.deserialize(bytes);
}
}
+ export class AutoReturnBox extends pb_1.Message {
+ #one_of_decls: number[][] = [];
+ constructor(data?: any[] | {
+ common?: CommonInfo;
+ code?: string;
+ flip?: boolean;
+ index?: number;
+ refStand?: string;
+ }) {
+ 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 ("flip" in data && data.flip != undefined) {
+ this.flip = data.flip;
+ }
+ if ("index" in data && data.index != undefined) {
+ this.index = data.index;
+ }
+ if ("refStand" in data && data.refStand != undefined) {
+ this.refStand = data.refStand;
+ }
+ }
+ }
+ 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 flip() {
+ return pb_1.Message.getFieldWithDefault(this, 3, false) as boolean;
+ }
+ set flip(value: boolean) {
+ pb_1.Message.setField(this, 3, value);
+ }
+ get index() {
+ return pb_1.Message.getFieldWithDefault(this, 4, 0) as number;
+ }
+ set index(value: number) {
+ pb_1.Message.setField(this, 4, value);
+ }
+ get refStand() {
+ return pb_1.Message.getFieldWithDefault(this, 5, "") as string;
+ }
+ set refStand(value: string) {
+ pb_1.Message.setField(this, 5, value);
+ }
+ static fromObject(data: {
+ common?: ReturnType;
+ code?: string;
+ flip?: boolean;
+ index?: number;
+ refStand?: string;
+ }): AutoReturnBox {
+ const message = new AutoReturnBox({});
+ if (data.common != null) {
+ message.common = CommonInfo.fromObject(data.common);
+ }
+ if (data.code != null) {
+ message.code = data.code;
+ }
+ if (data.flip != null) {
+ message.flip = data.flip;
+ }
+ if (data.index != null) {
+ message.index = data.index;
+ }
+ if (data.refStand != null) {
+ message.refStand = data.refStand;
+ }
+ return message;
+ }
+ toObject() {
+ const data: {
+ common?: ReturnType;
+ code?: string;
+ flip?: boolean;
+ index?: number;
+ refStand?: string;
+ } = {};
+ if (this.common != null) {
+ data.common = this.common.toObject();
+ }
+ if (this.code != null) {
+ data.code = this.code;
+ }
+ if (this.flip != null) {
+ data.flip = this.flip;
+ }
+ if (this.index != null) {
+ data.index = this.index;
+ }
+ if (this.refStand != null) {
+ data.refStand = this.refStand;
+ }
+ 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.flip != false)
+ writer.writeBool(3, this.flip);
+ if (this.index != 0)
+ writer.writeInt32(4, this.index);
+ if (this.refStand.length)
+ writer.writeString(5, this.refStand);
+ if (!w)
+ return writer.getResultBuffer();
+ }
+ static deserialize(bytes: Uint8Array | pb_1.BinaryReader): AutoReturnBox {
+ const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new AutoReturnBox();
+ 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.flip = reader.readBool();
+ break;
+ case 4:
+ message.index = reader.readInt32();
+ break;
+ case 5:
+ message.refStand = reader.readString();
+ break;
+ default: reader.skipField();
+ }
+ }
+ return message;
+ }
+ serializeBinary(): Uint8Array {
+ return this.serialize();
+ }
+ static deserializeBinary(bytes: Uint8Array): AutoReturnBox {
+ return AutoReturnBox.deserialize(bytes);
+ }
+ }
export class UniqueIdOfStationLayout extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
@@ -7741,4 +7972,194 @@ export namespace graphicData {
return SectionCodePoint.deserialize(bytes);
}
}
+ export class Train extends pb_1.Message {
+ #one_of_decls: number[][] = [];
+ constructor(data?: any[] | {
+ trainModel?: Train.TrainModel;
+ carriageLength?: number;
+ totalLength?: number;
+ minDiameter?: number;
+ maxDiameter?: number;
+ trainSets?: string;
+ }) {
+ super();
+ pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
+ if (!Array.isArray(data) && typeof data == "object") {
+ if ("trainModel" in data && data.trainModel != undefined) {
+ this.trainModel = data.trainModel;
+ }
+ if ("carriageLength" in data && data.carriageLength != undefined) {
+ this.carriageLength = data.carriageLength;
+ }
+ if ("totalLength" in data && data.totalLength != undefined) {
+ this.totalLength = data.totalLength;
+ }
+ if ("minDiameter" in data && data.minDiameter != undefined) {
+ this.minDiameter = data.minDiameter;
+ }
+ if ("maxDiameter" in data && data.maxDiameter != undefined) {
+ this.maxDiameter = data.maxDiameter;
+ }
+ if ("trainSets" in data && data.trainSets != undefined) {
+ this.trainSets = data.trainSets;
+ }
+ }
+ }
+ get trainModel() {
+ return pb_1.Message.getFieldWithDefault(this, 1, Train.TrainModel.A) as Train.TrainModel;
+ }
+ set trainModel(value: Train.TrainModel) {
+ pb_1.Message.setField(this, 1, value);
+ }
+ get carriageLength() {
+ return pb_1.Message.getFieldWithDefault(this, 2, 0) as number;
+ }
+ set carriageLength(value: number) {
+ pb_1.Message.setField(this, 2, value);
+ }
+ get totalLength() {
+ return pb_1.Message.getFieldWithDefault(this, 3, 0) as number;
+ }
+ set totalLength(value: number) {
+ pb_1.Message.setField(this, 3, value);
+ }
+ get minDiameter() {
+ return pb_1.Message.getFieldWithDefault(this, 4, 0) as number;
+ }
+ set minDiameter(value: number) {
+ pb_1.Message.setField(this, 4, value);
+ }
+ get maxDiameter() {
+ return pb_1.Message.getFieldWithDefault(this, 5, 0) as number;
+ }
+ set maxDiameter(value: number) {
+ pb_1.Message.setField(this, 5, value);
+ }
+ get trainSets() {
+ return pb_1.Message.getFieldWithDefault(this, 6, "") as string;
+ }
+ set trainSets(value: string) {
+ pb_1.Message.setField(this, 6, value);
+ }
+ static fromObject(data: {
+ trainModel?: Train.TrainModel;
+ carriageLength?: number;
+ totalLength?: number;
+ minDiameter?: number;
+ maxDiameter?: number;
+ trainSets?: string;
+ }): Train {
+ const message = new Train({});
+ if (data.trainModel != null) {
+ message.trainModel = data.trainModel;
+ }
+ if (data.carriageLength != null) {
+ message.carriageLength = data.carriageLength;
+ }
+ if (data.totalLength != null) {
+ message.totalLength = data.totalLength;
+ }
+ if (data.minDiameter != null) {
+ message.minDiameter = data.minDiameter;
+ }
+ if (data.maxDiameter != null) {
+ message.maxDiameter = data.maxDiameter;
+ }
+ if (data.trainSets != null) {
+ message.trainSets = data.trainSets;
+ }
+ return message;
+ }
+ toObject() {
+ const data: {
+ trainModel?: Train.TrainModel;
+ carriageLength?: number;
+ totalLength?: number;
+ minDiameter?: number;
+ maxDiameter?: number;
+ trainSets?: string;
+ } = {};
+ if (this.trainModel != null) {
+ data.trainModel = this.trainModel;
+ }
+ if (this.carriageLength != null) {
+ data.carriageLength = this.carriageLength;
+ }
+ if (this.totalLength != null) {
+ data.totalLength = this.totalLength;
+ }
+ if (this.minDiameter != null) {
+ data.minDiameter = this.minDiameter;
+ }
+ if (this.maxDiameter != null) {
+ data.maxDiameter = this.maxDiameter;
+ }
+ if (this.trainSets != null) {
+ data.trainSets = this.trainSets;
+ }
+ 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.trainModel != Train.TrainModel.A)
+ writer.writeEnum(1, this.trainModel);
+ if (this.carriageLength != 0)
+ writer.writeInt32(2, this.carriageLength);
+ if (this.totalLength != 0)
+ writer.writeInt32(3, this.totalLength);
+ if (this.minDiameter != 0)
+ writer.writeInt32(4, this.minDiameter);
+ if (this.maxDiameter != 0)
+ writer.writeInt32(5, this.maxDiameter);
+ if (this.trainSets.length)
+ writer.writeString(6, this.trainSets);
+ if (!w)
+ return writer.getResultBuffer();
+ }
+ static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Train {
+ const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Train();
+ while (reader.nextField()) {
+ if (reader.isEndGroup())
+ break;
+ switch (reader.getFieldNumber()) {
+ case 1:
+ message.trainModel = reader.readEnum();
+ break;
+ case 2:
+ message.carriageLength = reader.readInt32();
+ break;
+ case 3:
+ message.totalLength = reader.readInt32();
+ break;
+ case 4:
+ message.minDiameter = reader.readInt32();
+ break;
+ case 5:
+ message.maxDiameter = reader.readInt32();
+ break;
+ case 6:
+ message.trainSets = reader.readString();
+ break;
+ default: reader.skipField();
+ }
+ }
+ return message;
+ }
+ serializeBinary(): Uint8Array {
+ return this.serialize();
+ }
+ static deserializeBinary(bytes: Uint8Array): Train {
+ return Train.deserialize(bytes);
+ }
+ }
+ export namespace Train {
+ export enum TrainModel {
+ A = 0,
+ B = 1,
+ C = 2,
+ D = 3
+ }
+ }
}