diff --git a/bj-rtss-message b/bj-rtss-message
index 1736885..8bfe760 160000
--- a/bj-rtss-message
+++ b/bj-rtss-message
@@ -1 +1 @@
-Subproject commit 1736885b1a6902eb6276c645cfc4bc32b9d32487
+Subproject commit 8bfe7607b3def1979bae43d1f3623107740eadf0
diff --git a/public/drawIcon.svg b/public/drawIcon.svg
index e6ff62e..f450558 100644
--- a/public/drawIcon.svg
+++ b/public/drawIcon.svg
@@ -18,4 +18,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/draw-app/DrawProperties.vue b/src/components/draw-app/DrawProperties.vue
index bb0b5e4..7101d9b 100644
--- a/src/components/draw-app/DrawProperties.vue
+++ b/src/components/draw-app/DrawProperties.vue
@@ -81,6 +81,15 @@
+
+
+
@@ -118,6 +127,12 @@ import { AxleCountingSection } from 'src/graphics/axleCountingSection/AxleCounti
import { LogicSection } from 'src/graphics/logicSection/LogicSection';
import { Separator } from 'src/graphics/separator/Separator';
import { SectionLink } from 'src/graphics/sectionLink/SectionLink';
+import StopPositionProperty from './properties/StopPositionProperty.vue';
+import { StopPosition } from 'src/graphics/stopPosition/StopPosition';
+import SpksSwitchProperty from './properties/SpksSwitchProperty.vue';
+import { SpksSwitch } from 'src/graphics/spksSwitch/SpksSwitch';
+import GatedBoxProperty from './properties/GatedBoxProperty.vue';
+import { GatedBox } from 'src/graphics/gatedBox/GatedBox';
const drawStore = useDrawStore();
diff --git a/src/components/draw-app/properties/GatedBoxProperty.vue b/src/components/draw-app/properties/GatedBoxProperty.vue
new file mode 100644
index 0000000..169cdf4
--- /dev/null
+++ b/src/components/draw-app/properties/GatedBoxProperty.vue
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
diff --git a/src/components/draw-app/properties/SpksSwitchProperty.vue b/src/components/draw-app/properties/SpksSwitchProperty.vue
new file mode 100644
index 0000000..d46bbd1
--- /dev/null
+++ b/src/components/draw-app/properties/SpksSwitchProperty.vue
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
diff --git a/src/components/draw-app/properties/StopPositionProperty.vue b/src/components/draw-app/properties/StopPositionProperty.vue
new file mode 100644
index 0000000..395c4b5
--- /dev/null
+++ b/src/components/draw-app/properties/StopPositionProperty.vue
@@ -0,0 +1,69 @@
+
+
+
+
+
+
+
+
+
diff --git a/src/drawApp/graphics/GatedBoxInteraction.ts b/src/drawApp/graphics/GatedBoxInteraction.ts
new file mode 100644
index 0000000..5595f5e
--- /dev/null
+++ b/src/drawApp/graphics/GatedBoxInteraction.ts
@@ -0,0 +1,103 @@
+import * as pb_1 from 'google-protobuf';
+import { DisplayObject, FederatedMouseEvent } from 'pixi.js';
+import { GatedBox, IGatedBox } from 'src/graphics/gatedBox/GatedBox';
+import {
+ GraphicApp,
+ GraphicInteractionPlugin,
+ JlGraphic,
+} 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 } from './GraphicDataBase';
+
+export class GatedBoxData extends GraphicDataBase implements IGatedBox {
+ constructor(data?: graphicData.GatedBox) {
+ let gatedBox;
+ if (!data) {
+ gatedBox = new graphicData.GatedBox({
+ common: GraphicDataBase.defaultCommonInfo(GatedBox.Type),
+ });
+ } else {
+ gatedBox = data;
+ }
+ super(gatedBox);
+ }
+
+ public get data(): graphicData.GatedBox {
+ 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;
+ }
+ clone(): GatedBoxData {
+ return new GatedBoxData(this.data.cloneMessage());
+ }
+ copyFrom(data: GatedBoxData): void {
+ pb_1.Message.copyInto(data.data, this.data);
+ }
+ eq(other: GatedBoxData): boolean {
+ return pb_1.Message.equals(this.data, other.data);
+ }
+}
+
+const flipConfig: MenuItemOptions = {
+ name: '上下翻转',
+};
+const GatedBoxEditMenu: ContextMenu = ContextMenu.init({
+ name: 'Spks开关编辑菜单',
+ groups: [
+ {
+ items: [flipConfig],
+ },
+ ],
+});
+export class DrawGatedBoxInteraction extends GraphicInteractionPlugin {
+ static Name = 'gated_box_draw_right_menu';
+ constructor(app: GraphicApp) {
+ super(DrawGatedBoxInteraction.Name, app);
+ app.registerMenu(GatedBoxEditMenu);
+ }
+ static init(app: GraphicApp) {
+ return new DrawGatedBoxInteraction(app);
+ }
+ filter(...grahpics: JlGraphic[]): GatedBox[] | undefined {
+ return grahpics
+ .filter((g) => g.type === GatedBox.Type)
+ .map((g) => g as GatedBox);
+ }
+ bind(g: GatedBox): void {
+ g.on('_rightclick', this.onContextMenu, this);
+ }
+
+ unbind(g: GatedBox): void {
+ g.off('_rightclick', this.onContextMenu, this);
+ }
+
+ onContextMenu(e: FederatedMouseEvent) {
+ const target = e.target as DisplayObject;
+ const gatedBox = target.getGraphic() as GatedBox;
+ this.app.updateSelected(gatedBox);
+ flipConfig.handler = () => {
+ gatedBox.datas.flip = !gatedBox.datas.flip;
+ gatedBox.repaint();
+ };
+ GatedBoxEditMenu.open(e.global);
+ }
+}
diff --git a/src/drawApp/graphics/SpksSwitchInteraction.ts b/src/drawApp/graphics/SpksSwitchInteraction.ts
new file mode 100644
index 0000000..43c93fe
--- /dev/null
+++ b/src/drawApp/graphics/SpksSwitchInteraction.ts
@@ -0,0 +1,103 @@
+import * as pb_1 from 'google-protobuf';
+import { DisplayObject, FederatedMouseEvent } from 'pixi.js';
+import { ISpksSwitch, SpksSwitch } from 'src/graphics/spksSwitch/SpksSwitch';
+import {
+ GraphicApp,
+ GraphicInteractionPlugin,
+ JlGraphic,
+} 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 } from './GraphicDataBase';
+
+export class SpksSwitchData extends GraphicDataBase implements ISpksSwitch {
+ constructor(data?: graphicData.SpksSwitch) {
+ let spksSwitch;
+ if (!data) {
+ spksSwitch = new graphicData.SpksSwitch({
+ common: GraphicDataBase.defaultCommonInfo(SpksSwitch.Type),
+ });
+ } else {
+ spksSwitch = data;
+ }
+ super(spksSwitch);
+ }
+
+ public get data(): graphicData.SpksSwitch {
+ 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;
+ }
+ clone(): SpksSwitchData {
+ return new SpksSwitchData(this.data.cloneMessage());
+ }
+ copyFrom(data: SpksSwitchData): void {
+ pb_1.Message.copyInto(data.data, this.data);
+ }
+ eq(other: SpksSwitchData): boolean {
+ return pb_1.Message.equals(this.data, other.data);
+ }
+}
+
+const flipConfig: MenuItemOptions = {
+ name: '上下翻转',
+};
+const SpksSwitchEditMenu: ContextMenu = ContextMenu.init({
+ name: 'Spks开关编辑菜单',
+ groups: [
+ {
+ items: [flipConfig],
+ },
+ ],
+});
+export class DrawSpksSwitchInteraction extends GraphicInteractionPlugin {
+ static Name = 'spks_switch_draw_right_menu';
+ constructor(app: GraphicApp) {
+ super(DrawSpksSwitchInteraction.Name, app);
+ app.registerMenu(SpksSwitchEditMenu);
+ }
+ static init(app: GraphicApp) {
+ return new DrawSpksSwitchInteraction(app);
+ }
+ filter(...grahpics: JlGraphic[]): SpksSwitch[] | undefined {
+ return grahpics
+ .filter((g) => g.type === SpksSwitch.Type)
+ .map((g) => g as SpksSwitch);
+ }
+ bind(g: SpksSwitch): void {
+ g.on('_rightclick', this.onContextMenu, this);
+ }
+
+ unbind(g: SpksSwitch): void {
+ g.off('_rightclick', this.onContextMenu, this);
+ }
+
+ onContextMenu(e: FederatedMouseEvent) {
+ const target = e.target as DisplayObject;
+ const spksSwitch = target.getGraphic() as SpksSwitch;
+ this.app.updateSelected(spksSwitch);
+ flipConfig.handler = () => {
+ spksSwitch.datas.flip = !spksSwitch.datas.flip;
+ spksSwitch.repaint();
+ };
+ SpksSwitchEditMenu.open(e.global);
+ }
+}
diff --git a/src/drawApp/graphics/StopPositionInteraction.ts b/src/drawApp/graphics/StopPositionInteraction.ts
new file mode 100644
index 0000000..de69656
--- /dev/null
+++ b/src/drawApp/graphics/StopPositionInteraction.ts
@@ -0,0 +1,112 @@
+import * as pb_1 from 'google-protobuf';
+import { DisplayObject, FederatedMouseEvent } from 'pixi.js';
+import {
+ IStopPosition,
+ StopPosition,
+} from 'src/graphics/stopPosition/StopPosition';
+import {
+ GraphicApp,
+ GraphicInteractionPlugin,
+ JlGraphic,
+} 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 } from './GraphicDataBase';
+
+export class StopPositionData extends GraphicDataBase implements IStopPosition {
+ constructor(data?: graphicData.StopPosition) {
+ let stopPosition;
+ if (!data) {
+ stopPosition = new graphicData.StopPosition({
+ common: GraphicDataBase.defaultCommonInfo(StopPosition.Type),
+ });
+ } else {
+ stopPosition = data;
+ }
+ super(stopPosition);
+ }
+
+ public get data(): graphicData.StopPosition {
+ return this.getData();
+ }
+ get code(): string {
+ return this.data.code;
+ }
+ set code(v: string) {
+ this.data.code = v;
+ }
+ get coachNum(): graphicData.StopPosition.CoachNum {
+ return this.data.coachNum;
+ }
+ set coachNum(v: graphicData.StopPosition.CoachNum) {
+ this.data.coachNum = 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;
+ }
+ clone(): StopPositionData {
+ return new StopPositionData(this.data.cloneMessage());
+ }
+ copyFrom(data: StopPositionData): void {
+ pb_1.Message.copyInto(data.data, this.data);
+ }
+ eq(other: StopPositionData): boolean {
+ return pb_1.Message.equals(this.data, other.data);
+ }
+}
+
+const flipConfig: MenuItemOptions = {
+ name: '上下翻转',
+};
+const StopPositionEditMenu: ContextMenu = ContextMenu.init({
+ name: '停车标志位编辑菜单',
+ groups: [
+ {
+ items: [flipConfig],
+ },
+ ],
+});
+export class DrawStopPositionInteraction extends GraphicInteractionPlugin {
+ static Name = 'stop_position_draw_right_menu';
+ constructor(app: GraphicApp) {
+ super(DrawStopPositionInteraction.Name, app);
+ app.registerMenu(StopPositionEditMenu);
+ }
+ static init(app: GraphicApp) {
+ return new DrawStopPositionInteraction(app);
+ }
+ filter(...grahpics: JlGraphic[]): StopPosition[] | undefined {
+ return grahpics
+ .filter((g) => g.type === StopPosition.Type)
+ .map((g) => g as StopPosition);
+ }
+ bind(g: StopPosition): void {
+ g.on('_rightclick', this.onContextMenu, this);
+ }
+
+ unbind(g: StopPosition): void {
+ g.off('_rightclick', this.onContextMenu, this);
+ }
+
+ onContextMenu(e: FederatedMouseEvent) {
+ const target = e.target as DisplayObject;
+ const stopPosition = target.getGraphic() as StopPosition;
+ this.app.updateSelected(stopPosition);
+ flipConfig.handler = () => {
+ stopPosition.datas.flip = !stopPosition.datas.flip;
+ stopPosition.repaint();
+ };
+ StopPositionEditMenu.open(e.global);
+ }
+}
diff --git a/src/drawApp/index.ts b/src/drawApp/index.ts
index 9430bc9..bf7a2f2 100644
--- a/src/drawApp/index.ts
+++ b/src/drawApp/index.ts
@@ -73,8 +73,32 @@ import {
LogicSectionTemplate,
} from 'src/graphics/logicSection/LogicSection';
import { LogicSectionData } from './graphics/LogicSectionInteraction';
+import { StopPositionDraw } from 'src/graphics/stopPosition/StopPositionDrawAssistant';
+import {
+ StopPosition,
+ StopPositionTemplate,
+} from 'src/graphics/stopPosition/StopPosition';
+import {
+ StopPositionData,
+ DrawStopPositionInteraction,
+} from './graphics/StopPositionInteraction';
+import {
+ SpksSwitch,
+ SpksSwitchTemplate,
+} from 'src/graphics/spksSwitch/SpksSwitch';
+import {
+ SpksSwitchData,
+ DrawSpksSwitchInteraction,
+} from './graphics/SpksSwitchInteraction';
+import { GatedBox, GatedBoxTemplate } from 'src/graphics/gatedBox/GatedBox';
+import {
+ GatedBoxData,
+ DrawGatedBoxInteraction,
+} from './graphics/GatedBoxInteraction';
import { Notify, Dialog } from 'quasar';
import { checkMapData } from 'src/api/Simulation';
+import { SpksSwitchDraw } from 'src/graphics/spksSwitch/SpksSwitchDrawAssistant';
+import { GatedBoxDraw } from 'src/graphics/gatedBox/GatedBoxDrawAssistant';
// export function fromStoragePoint(p: graphicData.Point): Point {
// return new Point(p.x, p.y);
@@ -207,6 +231,9 @@ export function initDrawApp(dom: HTMLElement): JlDrawApp {
| SectionLinkDraw
| AxleCountingSectionDraw
| LogicSectionDraw
+ | StopPositionDraw
+ | SpksSwitchDraw
+ | GatedBoxDraw
)[] = [];
if (draftType === 'Line') {
drawAssistants = [
@@ -244,8 +271,17 @@ export function initDrawApp(dom: HTMLElement): JlDrawApp {
app,
new LogicSectionTemplate(new LogicSectionData())
),
+ new StopPositionDraw(
+ app,
+ new StopPositionTemplate(new StopPositionData())
+ ),
+ new SpksSwitchDraw(app, new SpksSwitchTemplate(new SpksSwitchData())),
+ new GatedBoxDraw(app, new GatedBoxTemplate(new GatedBoxData())),
];
DrawSignalInteraction.init(app);
+ DrawStopPositionInteraction.init(app);
+ DrawSpksSwitchInteraction.init(app);
+ DrawGatedBoxInteraction.init(app);
}
const isSupportDeletion = (g: JlGraphic) => {
if (g.type === LogicSection.Type && g.selected) {
@@ -437,6 +473,15 @@ export function saveDrawDatas(app: JlDrawApp) {
} else if (LogicSection.Type === g.type) {
const logicSectionData = (g as LogicSection).saveData();
storage.logicSections.push((logicSectionData as LogicSectionData).data);
+ } else if (StopPosition.Type === g.type) {
+ const stopPositionData = (g as StopPosition).saveData();
+ storage.stopPositions.push((stopPositionData as StopPositionData).data);
+ } else if (SpksSwitch.Type === g.type) {
+ const spksSwitchData = (g as SpksSwitch).saveData();
+ storage.spksSwitchs.push((spksSwitchData as SpksSwitchData).data);
+ } else if (GatedBox.Type === g.type) {
+ const gatedBoxData = (g as GatedBox).saveData();
+ storage.gateBoxs.push((gatedBoxData as GatedBoxData).data);
}
});
const base64 = fromUint8Array(storage.serialize());
@@ -505,6 +550,15 @@ export async function loadDrawDatas(app: GraphicApp) {
storage.logicSections.forEach((logicSection) => {
datas.push(new LogicSectionData(logicSection));
});
+ storage.stopPositions.forEach((stopPosition) => {
+ datas.push(new StopPositionData(stopPosition));
+ });
+ storage.spksSwitchs.forEach((spksSwitch) => {
+ datas.push(new SpksSwitchData(spksSwitch));
+ });
+ storage.gateBoxs.forEach((gatedBox) => {
+ datas.push(new GatedBoxData(gatedBox));
+ });
await app.loadGraphic(datas);
} else {
app.loadGraphic([]);
diff --git a/src/graphics/gatedBox/GatedBox.ts b/src/graphics/gatedBox/GatedBox.ts
new file mode 100644
index 0000000..85279ae
--- /dev/null
+++ b/src/graphics/gatedBox/GatedBox.ts
@@ -0,0 +1,91 @@
+import { Graphics } from 'pixi.js';
+import {
+ GraphicData,
+ JlGraphic,
+ JlGraphicTemplate,
+ VectorText,
+} from 'src/jl-graphic';
+
+export interface IGatedBox extends GraphicData {
+ get code(): string;
+ set code(v: string);
+ get flip(): boolean;
+ set flip(v: boolean);
+ get index(): number;
+ set index(v: number);
+ clone(): IGatedBox;
+ copyFrom(data: IGatedBox): void;
+ eq(other: IGatedBox): boolean;
+}
+
+const gatedBoxConsts = {
+ codeFontSize: 12,
+ codeColor: 0xffffff,
+ bodyLineColor: 0xffffff,
+ bodyLineWidth: 4,
+ bodyRectLineColor: 0xffffff,
+ bodyRectLineWidth: 2,
+ bodyRectWidth: 20,
+ bodyRectHeight: 20,
+ bodyColor: 0x000000,
+};
+export class GatedBox extends JlGraphic {
+ static Type = 'gatedBox';
+ codeGraph: VectorText = new VectorText(''); // 编组数量
+ rectBody: Graphics = new Graphics();
+ lineBody: Graphics = new Graphics();
+
+ constructor() {
+ super(GatedBox.Type);
+ this.addChild(this.codeGraph);
+ this.addChild(this.rectBody);
+ this.addChild(this.lineBody);
+ }
+ get datas(): IGatedBox {
+ return this.getDatas();
+ }
+ get code(): string {
+ return this.datas.index + '';
+ }
+ doRepaint(): void {
+ const codeGraph = this.codeGraph;
+ codeGraph.text = this.datas.code;
+ codeGraph.style.fill = gatedBoxConsts.codeColor;
+ codeGraph.setVectorFontSize(gatedBoxConsts.codeFontSize);
+ codeGraph.anchor.set(0.5);
+ this.rectBody.clear();
+ this.rectBody.beginFill(gatedBoxConsts.bodyColor, 0);
+ this.rectBody.lineStyle(
+ gatedBoxConsts.bodyRectLineWidth,
+ gatedBoxConsts.bodyRectLineColor
+ );
+ this.rectBody.drawRect(
+ -gatedBoxConsts.bodyRectWidth / 2,
+ -gatedBoxConsts.bodyRectHeight / 2,
+ gatedBoxConsts.bodyRectWidth,
+ gatedBoxConsts.bodyRectHeight
+ );
+ this.rectBody.endFill();
+ this.lineBody.clear();
+ const lineY = this.datas.flip
+ ? gatedBoxConsts.bodyRectHeight / 2
+ : -gatedBoxConsts.bodyRectHeight / 2;
+ this.lineBody.lineStyle(
+ gatedBoxConsts.bodyLineWidth,
+ gatedBoxConsts.bodyLineColor
+ );
+ this.lineBody.moveTo(-gatedBoxConsts.bodyRectWidth / 2, lineY);
+ this.lineBody.lineTo(gatedBoxConsts.bodyRectWidth / 2, lineY);
+ }
+}
+
+export class GatedBoxTemplate extends JlGraphicTemplate {
+ constructor(dataTemplate: IGatedBox) {
+ super(GatedBox.Type, { dataTemplate });
+ }
+ new(): GatedBox {
+ const gatedBox = new GatedBox();
+ gatedBox.loadData(this.datas);
+ return gatedBox;
+ }
+}
diff --git a/src/graphics/gatedBox/GatedBoxDrawAssistant.ts b/src/graphics/gatedBox/GatedBoxDrawAssistant.ts
new file mode 100644
index 0000000..3fe9720
--- /dev/null
+++ b/src/graphics/gatedBox/GatedBoxDrawAssistant.ts
@@ -0,0 +1,118 @@
+import { DisplayObject, FederatedMouseEvent, Point } from 'pixi.js';
+import {
+ AbsorbableLine,
+ AbsorbablePosition,
+ GraphicDrawAssistant,
+ GraphicInteractionPlugin,
+ GraphicTransformEvent,
+ JlDrawApp,
+ JlGraphic,
+} from 'src/jl-graphic';
+import { GatedBox, GatedBoxTemplate, IGatedBox } from './GatedBox';
+
+export interface IGatedBoxDrawOptions {
+ newData: () => IGatedBox;
+}
+export class GatedBoxDraw extends GraphicDrawAssistant<
+ GatedBoxTemplate,
+ IGatedBox
+> {
+ _gatedBox: GatedBox | null = null;
+ constructor(app: JlDrawApp, template: GatedBoxTemplate) {
+ super(
+ app,
+ template,
+ 'svguse:../../drawIcon.svg#icon-gated-box',
+ '设置门控箱GatedBox'
+ );
+ GatedBoxInteraction.init(app);
+ }
+ public get gatedBox(): GatedBox {
+ if (!this._gatedBox) {
+ this._gatedBox = this.graphicTemplate.new();
+ this._gatedBox.loadData(this.graphicTemplate.datas);
+ this.container.addChild(this._gatedBox);
+ }
+ return this._gatedBox;
+ }
+
+ onRightClick(): void {
+ this.createAndStore(true);
+ }
+
+ onLeftUp(e: FederatedMouseEvent): void {
+ this.container.position.copyFrom(this.toCanvasCoordinates(e.global));
+ this.createAndStore(true);
+ }
+
+ redraw(p: Point): void {
+ this.gatedBox.repaint();
+ this.container.position.set(p.x, p.y);
+ }
+
+ prepareData(data: IGatedBox): boolean {
+ data.transform = this.container.saveTransform();
+ data.code = 'P';
+ return true;
+ }
+}
+/**
+ * 构建吸附线
+ * @param gatedBox
+ */
+function buildAbsorbablePositions(gatedBox: GatedBox): AbsorbablePosition[] {
+ const aps: AbsorbablePosition[] = [];
+ const gatedBoxs = gatedBox.queryStore.queryByType(GatedBox.Type);
+ const canvas = gatedBox.getCanvas();
+ gatedBoxs.forEach((item) => {
+ if (item.id === gatedBox.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 GatedBoxInteraction extends GraphicInteractionPlugin {
+ static Name = 'gated_box_transform';
+ constructor(app: JlDrawApp) {
+ super(GatedBoxInteraction.Name, app);
+ }
+ static init(app: JlDrawApp) {
+ return new GatedBoxInteraction(app);
+ }
+ filter(...grahpics: JlGraphic[]): GatedBox[] | undefined {
+ return grahpics
+ .filter((g) => g.type === GatedBox.Type)
+ .map((g) => g as GatedBox);
+ }
+ bind(g: GatedBox): void {
+ g.eventMode = 'static';
+ g.cursor = 'pointer';
+ g.scalable = true;
+ g.rotatable = true;
+ g.on('transformstart', this.transformstart, this);
+ }
+ unbind(g: GatedBox): void {
+ g.eventMode = 'none';
+ g.scalable = false;
+ g.rotatable = false;
+ g.off('transformstart', this.transformstart, this);
+ }
+ transformstart(e: GraphicTransformEvent) {
+ const target = e.target as DisplayObject;
+ const gatedBox = target.getGraphic() as GatedBox;
+ gatedBox.getGraphicApp().setOptions({
+ absorbablePositions: buildAbsorbablePositions(gatedBox),
+ });
+ }
+}
diff --git a/src/graphics/signal/SignalDrawAssistant.ts b/src/graphics/signal/SignalDrawAssistant.ts
index 2ca66e0..efd68b1 100644
--- a/src/graphics/signal/SignalDrawAssistant.ts
+++ b/src/graphics/signal/SignalDrawAssistant.ts
@@ -29,14 +29,14 @@ export class SignalDraw extends GraphicDrawAssistant<
'信号机Signal'
);
- signalInteraction.init(app);
+ SignalInteraction.init(app);
}
public get signal(): Signal {
if (!this._signal) {
this._signal = this.graphicTemplate.new();
- this.signal.loadData(this.graphicTemplate.datas);
- this.container.addChild(this.signal);
+ this._signal.loadData(this.graphicTemplate.datas);
+ this.container.addChild(this._signal);
}
return this._signal;
}
@@ -111,13 +111,13 @@ function buildCodeAbsorbablePositions(signal: Signal): AbsorbablePosition[] {
return aps;
}
-export class signalInteraction extends GraphicInteractionPlugin {
+export class SignalInteraction extends GraphicInteractionPlugin {
static Name = 'signal_transform';
constructor(app: JlDrawApp) {
- super(signalInteraction.Name, app);
+ super(SignalInteraction.Name, app);
}
static init(app: JlDrawApp) {
- return new signalInteraction(app);
+ return new SignalInteraction(app);
}
filter(...grahpics: JlGraphic[]): Signal[] | undefined {
return grahpics
diff --git a/src/graphics/spksSwitch/SpksSwitch.ts b/src/graphics/spksSwitch/SpksSwitch.ts
new file mode 100644
index 0000000..ba4822a
--- /dev/null
+++ b/src/graphics/spksSwitch/SpksSwitch.ts
@@ -0,0 +1,91 @@
+import { Graphics } from 'pixi.js';
+import {
+ GraphicData,
+ JlGraphic,
+ JlGraphicTemplate,
+ VectorText,
+} from 'src/jl-graphic';
+
+export interface ISpksSwitch extends GraphicData {
+ get code(): string;
+ set code(v: string);
+ get flip(): boolean;
+ set flip(v: boolean);
+ get index(): number;
+ set index(v: number);
+ clone(): ISpksSwitch;
+ copyFrom(data: ISpksSwitch): void;
+ eq(other: ISpksSwitch): boolean;
+}
+
+const spksSwitchConsts = {
+ codeFontSize: 12,
+ codeColor: 0xffffff,
+ bodyLineColor: 0xffffff,
+ bodyLineWidth: 4,
+ bodyRectLineColor: 0xffffff,
+ bodyRectLineWidth: 2,
+ bodyRectWidth: 20,
+ bodyRectHeight: 20,
+ bodyColor: 0x000000,
+};
+export class SpksSwitch extends JlGraphic {
+ static Type = 'spksSwitch';
+ codeGraph: VectorText = new VectorText(''); // 编组数量
+ rectBody: Graphics = new Graphics();
+ lineBody: Graphics = new Graphics();
+
+ constructor() {
+ super(SpksSwitch.Type);
+ this.addChild(this.codeGraph);
+ this.addChild(this.rectBody);
+ this.addChild(this.lineBody);
+ }
+ get datas(): ISpksSwitch {
+ return this.getDatas();
+ }
+ get code(): string {
+ return this.datas.index + '';
+ }
+ doRepaint(): void {
+ const codeGraph = this.codeGraph;
+ codeGraph.text = this.datas.code;
+ codeGraph.style.fill = spksSwitchConsts.codeColor;
+ codeGraph.setVectorFontSize(spksSwitchConsts.codeFontSize);
+ codeGraph.anchor.set(0.5);
+ this.rectBody.clear();
+ this.rectBody.beginFill(spksSwitchConsts.bodyColor, 0);
+ this.rectBody.lineStyle(
+ spksSwitchConsts.bodyRectLineWidth,
+ spksSwitchConsts.bodyRectLineColor
+ );
+ this.rectBody.drawRect(
+ -spksSwitchConsts.bodyRectWidth / 2,
+ -spksSwitchConsts.bodyRectHeight / 2,
+ spksSwitchConsts.bodyRectWidth,
+ spksSwitchConsts.bodyRectHeight
+ );
+ this.rectBody.endFill();
+ this.lineBody.clear();
+ const lineY = this.datas.flip
+ ? spksSwitchConsts.bodyRectHeight / 2
+ : -spksSwitchConsts.bodyRectHeight / 2;
+ this.lineBody.lineStyle(
+ spksSwitchConsts.bodyLineWidth,
+ spksSwitchConsts.bodyLineColor
+ );
+ this.lineBody.moveTo(-spksSwitchConsts.bodyRectWidth / 2, lineY);
+ this.lineBody.lineTo(spksSwitchConsts.bodyRectWidth / 2, lineY);
+ }
+}
+
+export class SpksSwitchTemplate extends JlGraphicTemplate {
+ constructor(dataTemplate: ISpksSwitch) {
+ super(SpksSwitch.Type, { dataTemplate });
+ }
+ new(): SpksSwitch {
+ const spksSwitch = new SpksSwitch();
+ spksSwitch.loadData(this.datas);
+ return spksSwitch;
+ }
+}
diff --git a/src/graphics/spksSwitch/SpksSwitchDrawAssistant.ts b/src/graphics/spksSwitch/SpksSwitchDrawAssistant.ts
new file mode 100644
index 0000000..a0c8bec
--- /dev/null
+++ b/src/graphics/spksSwitch/SpksSwitchDrawAssistant.ts
@@ -0,0 +1,122 @@
+import { DisplayObject, FederatedMouseEvent, Point } from 'pixi.js';
+import {
+ AbsorbableLine,
+ AbsorbablePosition,
+ GraphicDrawAssistant,
+ GraphicInteractionPlugin,
+ GraphicTransformEvent,
+ JlDrawApp,
+ JlGraphic,
+} from 'src/jl-graphic';
+import { ISpksSwitch, SpksSwitch, SpksSwitchTemplate } from './SpksSwitch';
+
+export interface ISpksSwitchDrawOptions {
+ newData: () => ISpksSwitch;
+}
+export class SpksSwitchDraw extends GraphicDrawAssistant<
+ SpksSwitchTemplate,
+ ISpksSwitch
+> {
+ _spksSwitch: SpksSwitch | null = null;
+ constructor(app: JlDrawApp, template: SpksSwitchTemplate) {
+ super(
+ app,
+ template,
+ 'svguse:../../drawIcon.svg#icon-spks-switch',
+ 'Spks开关SpksSwitch'
+ );
+ SpksSwitchInteraction.init(app);
+ }
+ public get spksSwitch(): SpksSwitch {
+ if (!this._spksSwitch) {
+ this._spksSwitch = this.graphicTemplate.new();
+ this._spksSwitch.loadData(this.graphicTemplate.datas);
+ this.container.addChild(this._spksSwitch);
+ }
+ return this._spksSwitch;
+ }
+
+ onRightClick(): void {
+ this.createAndStore(true);
+ }
+
+ onLeftUp(e: FederatedMouseEvent): void {
+ this.container.position.copyFrom(this.toCanvasCoordinates(e.global));
+ this.createAndStore(true);
+ }
+
+ redraw(p: Point): void {
+ this.spksSwitch.repaint();
+ this.container.position.set(p.x, p.y);
+ }
+
+ prepareData(data: ISpksSwitch): boolean {
+ data.transform = this.container.saveTransform();
+ data.code = 'S';
+ return true;
+ }
+}
+/**
+ * 构建吸附线
+ * @param spksSwitch
+ */
+function buildAbsorbablePositions(
+ spksSwitch: SpksSwitch
+): AbsorbablePosition[] {
+ const aps: AbsorbablePosition[] = [];
+ const spksSwitchs = spksSwitch.queryStore.queryByType(
+ SpksSwitch.Type
+ );
+ const canvas = spksSwitch.getCanvas();
+ spksSwitchs.forEach((item) => {
+ if (item.id === spksSwitch.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 SpksSwitchInteraction extends GraphicInteractionPlugin {
+ static Name = 'spks_switch_transform';
+ constructor(app: JlDrawApp) {
+ super(SpksSwitchInteraction.Name, app);
+ }
+ static init(app: JlDrawApp) {
+ return new SpksSwitchInteraction(app);
+ }
+ filter(...grahpics: JlGraphic[]): SpksSwitch[] | undefined {
+ return grahpics
+ .filter((g) => g.type === SpksSwitch.Type)
+ .map((g) => g as SpksSwitch);
+ }
+ bind(g: SpksSwitch): void {
+ g.eventMode = 'static';
+ g.cursor = 'pointer';
+ g.scalable = true;
+ g.rotatable = true;
+ g.on('transformstart', this.transformstart, this);
+ }
+ unbind(g: SpksSwitch): void {
+ g.eventMode = 'none';
+ g.scalable = false;
+ g.rotatable = false;
+ g.off('transformstart', this.transformstart, this);
+ }
+ transformstart(e: GraphicTransformEvent) {
+ const target = e.target as DisplayObject;
+ const spksSwitch = target.getGraphic() as SpksSwitch;
+ spksSwitch.getGraphicApp().setOptions({
+ absorbablePositions: buildAbsorbablePositions(spksSwitch),
+ });
+ }
+}
diff --git a/src/graphics/stopPosition/StopPosition.ts b/src/graphics/stopPosition/StopPosition.ts
index e69de29..6a194f8 100644
--- a/src/graphics/stopPosition/StopPosition.ts
+++ b/src/graphics/stopPosition/StopPosition.ts
@@ -0,0 +1,92 @@
+import { Graphics } from 'pixi.js';
+import {
+ GraphicData,
+ JlGraphic,
+ JlGraphicTemplate,
+ VectorText,
+} from 'src/jl-graphic';
+
+export enum CoachNum {
+ Four = 0,
+ Six = 1,
+}
+
+export interface IStopPosition extends GraphicData {
+ get code(): string;
+ set code(v: string);
+ get flip(): boolean;
+ set flip(v: boolean);
+ get coachNum(): CoachNum;
+ set coachNum(v: CoachNum);
+ get index(): number;
+ set index(v: number);
+ clone(): IStopPosition;
+ copyFrom(data: IStopPosition): void;
+ eq(other: IStopPosition): boolean;
+}
+
+const stopPositionConsts = {
+ codeFontSize: 12,
+ codeColor: 0xff0000,
+ bodyLineColor: 0xff0000,
+ bodyLineWidth: 2,
+ bodyColor: 0x000000,
+ radius: 10,
+};
+export class StopPosition extends JlGraphic {
+ static Type = 'stopPosition';
+ codeGraph: VectorText = new VectorText(''); // 编组数量
+ signBody: Graphics = new Graphics();
+
+ constructor() {
+ super(StopPosition.Type);
+ this.addChild(this.codeGraph);
+ this.addChild(this.signBody);
+ }
+ get datas(): IStopPosition {
+ return this.getDatas();
+ }
+ get code(): string {
+ return this.datas.index + '';
+ }
+ doRepaint(): void {
+ const codeGraph = this.codeGraph;
+ if (this.datas.coachNum === CoachNum.Four) {
+ codeGraph.text = '4';
+ } else if (this.datas.coachNum === CoachNum.Six) {
+ codeGraph.text = '6';
+ }
+ codeGraph.style.fill = stopPositionConsts.codeColor;
+ codeGraph.setVectorFontSize(stopPositionConsts.codeFontSize);
+ codeGraph.anchor.set(0.5);
+ this.signBody.clear();
+ this.signBody.beginFill(stopPositionConsts.bodyColor, 0);
+ if (this.signBody.drawRegularPolygon) {
+ this.signBody.lineStyle(
+ stopPositionConsts.bodyLineWidth,
+ stopPositionConsts.bodyLineColor
+ );
+ const rotation = this.datas.flip ? 0 : Math.PI;
+ this.signBody.drawRegularPolygon(
+ 0,
+ 0,
+ stopPositionConsts.radius,
+ 3,
+ rotation
+ );
+ }
+ this.signBody.endFill();
+ }
+}
+
+export class StopPositionTemplate extends JlGraphicTemplate {
+ coachNum: CoachNum = CoachNum.Four;
+ constructor(dataTemplate: IStopPosition) {
+ super(StopPosition.Type, { dataTemplate });
+ }
+ new(): StopPosition {
+ const stopPosition = new StopPosition();
+ stopPosition.loadData(this.datas);
+ return stopPosition;
+ }
+}
diff --git a/src/graphics/stopPosition/StopPositionDrawAssistant.ts b/src/graphics/stopPosition/StopPositionDrawAssistant.ts
index e69de29..35a379d 100644
--- a/src/graphics/stopPosition/StopPositionDrawAssistant.ts
+++ b/src/graphics/stopPosition/StopPositionDrawAssistant.ts
@@ -0,0 +1,125 @@
+import { DisplayObject, FederatedMouseEvent, Point } from 'pixi.js';
+import {
+ AbsorbableLine,
+ AbsorbablePosition,
+ GraphicDrawAssistant,
+ GraphicInteractionPlugin,
+ GraphicTransformEvent,
+ JlDrawApp,
+ JlGraphic,
+} from 'src/jl-graphic';
+import {
+ IStopPosition,
+ StopPosition,
+ StopPositionTemplate,
+} from './StopPosition';
+
+export interface IStopPositionDrawOptions {
+ newData: () => IStopPosition;
+}
+export class StopPositionDraw extends GraphicDrawAssistant<
+ StopPositionTemplate,
+ IStopPosition
+> {
+ _stopPosition: StopPosition | null = null;
+ constructor(app: JlDrawApp, template: StopPositionTemplate) {
+ super(
+ app,
+ template,
+ 'svguse:../../drawIcon.svg#icon-stop-position',
+ '停车位置标StopPosition'
+ );
+ StopPositionInteraction.init(app);
+ }
+ public get stopPosition(): StopPosition {
+ if (!this._stopPosition) {
+ this._stopPosition = this.graphicTemplate.new();
+ this._stopPosition.loadData(this.graphicTemplate.datas);
+ this.container.addChild(this._stopPosition);
+ }
+ return this._stopPosition;
+ }
+
+ onRightClick(): void {
+ this.createAndStore(true);
+ }
+
+ onLeftUp(e: FederatedMouseEvent): void {
+ this.container.position.copyFrom(this.toCanvasCoordinates(e.global));
+ this.createAndStore(true);
+ }
+
+ redraw(p: Point): void {
+ this.stopPosition.repaint();
+ this.container.position.set(p.x, p.y);
+ }
+
+ prepareData(data: IStopPosition): boolean {
+ data.transform = this.container.saveTransform();
+ return true;
+ }
+}
+/**
+ * 构建吸附线
+ * @param spksSwitch
+ */
+function buildAbsorbablePositions(
+ stopPosition: StopPosition
+): AbsorbablePosition[] {
+ const aps: AbsorbablePosition[] = [];
+ const stopPositions = stopPosition.queryStore.queryByType(
+ StopPosition.Type
+ );
+ const canvas = stopPosition.getCanvas();
+ stopPositions.forEach((item) => {
+ if (item.id === stopPosition.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 StopPositionInteraction extends GraphicInteractionPlugin {
+ static Name = 'stop_position_transform';
+ constructor(app: JlDrawApp) {
+ super(StopPositionInteraction.Name, app);
+ }
+ static init(app: JlDrawApp) {
+ return new StopPositionInteraction(app);
+ }
+ filter(...grahpics: JlGraphic[]): StopPosition[] | undefined {
+ return grahpics
+ .filter((g) => g.type === StopPosition.Type)
+ .map((g) => g as StopPosition);
+ }
+ bind(g: StopPosition): void {
+ g.eventMode = 'static';
+ g.cursor = 'pointer';
+ g.scalable = true;
+ g.rotatable = true;
+ g.on('transformstart', this.transformstart, this);
+ }
+ unbind(g: StopPosition): void {
+ g.eventMode = 'none';
+ g.scalable = false;
+ g.rotatable = false;
+ g.off('transformstart', this.transformstart, this);
+ }
+ transformstart(e: GraphicTransformEvent) {
+ const target = e.target as DisplayObject;
+ const stopPosition = target.getGraphic() as StopPosition;
+ stopPosition.getGraphicApp().setOptions({
+ absorbablePositions: buildAbsorbablePositions(stopPosition),
+ });
+ }
+}
diff --git a/src/protos/stationLayoutGraphics.ts b/src/protos/stationLayoutGraphics.ts
index f10d9bd..4c97b26 100644
--- a/src/protos/stationLayoutGraphics.ts
+++ b/src/protos/stationLayoutGraphics.ts
@@ -21,9 +21,9 @@ export namespace graphicData {
axleCountingSections?: AxleCountingSection[];
logicSections?: LogicSection[];
stopPositions?: StopPosition[];
- skpsSwitchs?: SkpsSwitch[];
+ spksSwitchs?: SpksSwitch[];
esbButtons?: EsbButton[];
- gateBox?: GatedBox[];
+ gateBoxs?: GatedBox[];
}) {
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], this.#one_of_decls);
@@ -67,14 +67,14 @@ export namespace graphicData {
if ("stopPositions" in data && data.stopPositions != undefined) {
this.stopPositions = data.stopPositions;
}
- if ("skpsSwitchs" in data && data.skpsSwitchs != undefined) {
- this.skpsSwitchs = data.skpsSwitchs;
+ if ("spksSwitchs" in data && data.spksSwitchs != undefined) {
+ this.spksSwitchs = data.spksSwitchs;
}
if ("esbButtons" in data && data.esbButtons != undefined) {
this.esbButtons = data.esbButtons;
}
- if ("gateBox" in data && data.gateBox != undefined) {
- this.gateBox = data.gateBox;
+ if ("gateBoxs" in data && data.gateBoxs != undefined) {
+ this.gateBoxs = data.gateBoxs;
}
}
}
@@ -159,10 +159,10 @@ export namespace graphicData {
set stopPositions(value: StopPosition[]) {
pb_1.Message.setRepeatedWrapperField(this, 18, value);
}
- get skpsSwitchs() {
- return pb_1.Message.getRepeatedWrapperField(this, SkpsSwitch, 19) as SkpsSwitch[];
+ get spksSwitchs() {
+ return pb_1.Message.getRepeatedWrapperField(this, SpksSwitch, 19) as SpksSwitch[];
}
- set skpsSwitchs(value: SkpsSwitch[]) {
+ set spksSwitchs(value: SpksSwitch[]) {
pb_1.Message.setRepeatedWrapperField(this, 19, value);
}
get esbButtons() {
@@ -171,10 +171,10 @@ export namespace graphicData {
set esbButtons(value: EsbButton[]) {
pb_1.Message.setRepeatedWrapperField(this, 20, value);
}
- get gateBox() {
+ get gateBoxs() {
return pb_1.Message.getRepeatedWrapperField(this, GatedBox, 21) as GatedBox[];
}
- set gateBox(value: GatedBox[]) {
+ set gateBoxs(value: GatedBox[]) {
pb_1.Message.setRepeatedWrapperField(this, 21, value);
}
static fromObject(data: {
@@ -191,9 +191,9 @@ export namespace graphicData {
axleCountingSections?: ReturnType[];
logicSections?: ReturnType[];
stopPositions?: ReturnType[];
- skpsSwitchs?: ReturnType[];
+ spksSwitchs?: ReturnType[];
esbButtons?: ReturnType[];
- gateBox?: ReturnType[];
+ gateBoxs?: ReturnType[];
}): RtssGraphicStorage {
const message = new RtssGraphicStorage({});
if (data.canvas != null) {
@@ -235,14 +235,14 @@ export namespace graphicData {
if (data.stopPositions != null) {
message.stopPositions = data.stopPositions.map(item => StopPosition.fromObject(item));
}
- if (data.skpsSwitchs != null) {
- message.skpsSwitchs = data.skpsSwitchs.map(item => SkpsSwitch.fromObject(item));
+ if (data.spksSwitchs != null) {
+ message.spksSwitchs = data.spksSwitchs.map(item => SpksSwitch.fromObject(item));
}
if (data.esbButtons != null) {
message.esbButtons = data.esbButtons.map(item => EsbButton.fromObject(item));
}
- if (data.gateBox != null) {
- message.gateBox = data.gateBox.map(item => GatedBox.fromObject(item));
+ if (data.gateBoxs != null) {
+ message.gateBoxs = data.gateBoxs.map(item => GatedBox.fromObject(item));
}
return message;
}
@@ -261,9 +261,9 @@ export namespace graphicData {
axleCountingSections?: ReturnType[];
logicSections?: ReturnType[];
stopPositions?: ReturnType[];
- skpsSwitchs?: ReturnType[];
+ spksSwitchs?: ReturnType[];
esbButtons?: ReturnType[];
- gateBox?: ReturnType[];
+ gateBoxs?: ReturnType[];
} = {};
if (this.canvas != null) {
data.canvas = this.canvas.toObject();
@@ -304,14 +304,14 @@ export namespace graphicData {
if (this.stopPositions != null) {
data.stopPositions = this.stopPositions.map((item: StopPosition) => item.toObject());
}
- if (this.skpsSwitchs != null) {
- data.skpsSwitchs = this.skpsSwitchs.map((item: SkpsSwitch) => item.toObject());
+ if (this.spksSwitchs != null) {
+ data.spksSwitchs = this.spksSwitchs.map((item: SpksSwitch) => item.toObject());
}
if (this.esbButtons != null) {
data.esbButtons = this.esbButtons.map((item: EsbButton) => item.toObject());
}
- if (this.gateBox != null) {
- data.gateBox = this.gateBox.map((item: GatedBox) => item.toObject());
+ if (this.gateBoxs != null) {
+ data.gateBoxs = this.gateBoxs.map((item: GatedBox) => item.toObject());
}
return data;
}
@@ -345,12 +345,12 @@ export namespace graphicData {
writer.writeRepeatedMessage(17, this.logicSections, (item: LogicSection) => item.serialize(writer));
if (this.stopPositions.length)
writer.writeRepeatedMessage(18, this.stopPositions, (item: StopPosition) => item.serialize(writer));
- if (this.skpsSwitchs.length)
- writer.writeRepeatedMessage(19, this.skpsSwitchs, (item: SkpsSwitch) => item.serialize(writer));
+ if (this.spksSwitchs.length)
+ writer.writeRepeatedMessage(19, this.spksSwitchs, (item: SpksSwitch) => item.serialize(writer));
if (this.esbButtons.length)
writer.writeRepeatedMessage(20, this.esbButtons, (item: EsbButton) => item.serialize(writer));
- if (this.gateBox.length)
- writer.writeRepeatedMessage(21, this.gateBox, (item: GatedBox) => item.serialize(writer));
+ if (this.gateBoxs.length)
+ writer.writeRepeatedMessage(21, this.gateBoxs, (item: GatedBox) => item.serialize(writer));
if (!w)
return writer.getResultBuffer();
}
@@ -400,13 +400,13 @@ export namespace graphicData {
reader.readMessage(message.stopPositions, () => pb_1.Message.addToRepeatedWrapperField(message, 18, StopPosition.deserialize(reader), StopPosition));
break;
case 19:
- reader.readMessage(message.skpsSwitchs, () => pb_1.Message.addToRepeatedWrapperField(message, 19, SkpsSwitch.deserialize(reader), SkpsSwitch));
+ reader.readMessage(message.spksSwitchs, () => pb_1.Message.addToRepeatedWrapperField(message, 19, SpksSwitch.deserialize(reader), SpksSwitch));
break;
case 20:
reader.readMessage(message.esbButtons, () => pb_1.Message.addToRepeatedWrapperField(message, 20, EsbButton.deserialize(reader), EsbButton));
break;
case 21:
- reader.readMessage(message.gateBox, () => pb_1.Message.addToRepeatedWrapperField(message, 21, GatedBox.deserialize(reader), GatedBox));
+ reader.readMessage(message.gateBoxs, () => pb_1.Message.addToRepeatedWrapperField(message, 21, GatedBox.deserialize(reader), GatedBox));
break;
default: reader.skipField();
}
@@ -3542,6 +3542,7 @@ export namespace graphicData {
code?: string;
flip?: boolean;
coachNum?: StopPosition.CoachNum;
+ index?: number;
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
@@ -3558,6 +3559,9 @@ export namespace graphicData {
if ("coachNum" in data && data.coachNum != undefined) {
this.coachNum = data.coachNum;
}
+ if ("index" in data && data.index != undefined) {
+ this.index = data.index;
+ }
}
}
get common() {
@@ -3587,11 +3591,18 @@ export namespace graphicData {
set coachNum(value: StopPosition.CoachNum) {
pb_1.Message.setField(this, 4, value);
}
+ get index() {
+ return pb_1.Message.getFieldWithDefault(this, 5, 0) as number;
+ }
+ set index(value: number) {
+ pb_1.Message.setField(this, 5, value);
+ }
static fromObject(data: {
common?: ReturnType;
code?: string;
flip?: boolean;
coachNum?: StopPosition.CoachNum;
+ index?: number;
}): StopPosition {
const message = new StopPosition({});
if (data.common != null) {
@@ -3606,6 +3617,9 @@ export namespace graphicData {
if (data.coachNum != null) {
message.coachNum = data.coachNum;
}
+ if (data.index != null) {
+ message.index = data.index;
+ }
return message;
}
toObject() {
@@ -3614,6 +3628,7 @@ export namespace graphicData {
code?: string;
flip?: boolean;
coachNum?: StopPosition.CoachNum;
+ index?: number;
} = {};
if (this.common != null) {
data.common = this.common.toObject();
@@ -3627,6 +3642,9 @@ export namespace graphicData {
if (this.coachNum != null) {
data.coachNum = this.coachNum;
}
+ if (this.index != null) {
+ data.index = this.index;
+ }
return data;
}
serialize(): Uint8Array;
@@ -3641,6 +3659,8 @@ export namespace graphicData {
writer.writeBool(3, this.flip);
if (this.coachNum != StopPosition.CoachNum.Four)
writer.writeEnum(4, this.coachNum);
+ if (this.index != 0)
+ writer.writeInt32(5, this.index);
if (!w)
return writer.getResultBuffer();
}
@@ -3662,6 +3682,9 @@ export namespace graphicData {
case 4:
message.coachNum = reader.readEnum();
break;
+ case 5:
+ message.index = reader.readInt32();
+ break;
default: reader.skipField();
}
}
@@ -3680,12 +3703,13 @@ export namespace graphicData {
Six = 1
}
}
- export class SkpsSwitch extends pb_1.Message {
+ export class SpksSwitch extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
common?: CommonInfo;
code?: string;
flip?: boolean;
+ index?: number;
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
@@ -3699,6 +3723,9 @@ export namespace graphicData {
if ("flip" in data && data.flip != undefined) {
this.flip = data.flip;
}
+ if ("index" in data && data.index != undefined) {
+ this.index = data.index;
+ }
}
}
get common() {
@@ -3722,12 +3749,19 @@ export namespace graphicData {
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);
+ }
static fromObject(data: {
common?: ReturnType;
code?: string;
flip?: boolean;
- }): SkpsSwitch {
- const message = new SkpsSwitch({});
+ index?: number;
+ }): SpksSwitch {
+ const message = new SpksSwitch({});
if (data.common != null) {
message.common = CommonInfo.fromObject(data.common);
}
@@ -3737,6 +3771,9 @@ export namespace graphicData {
if (data.flip != null) {
message.flip = data.flip;
}
+ if (data.index != null) {
+ message.index = data.index;
+ }
return message;
}
toObject() {
@@ -3744,6 +3781,7 @@ export namespace graphicData {
common?: ReturnType;
code?: string;
flip?: boolean;
+ index?: number;
} = {};
if (this.common != null) {
data.common = this.common.toObject();
@@ -3754,6 +3792,9 @@ export namespace graphicData {
if (this.flip != null) {
data.flip = this.flip;
}
+ if (this.index != null) {
+ data.index = this.index;
+ }
return data;
}
serialize(): Uint8Array;
@@ -3766,11 +3807,13 @@ export namespace graphicData {
writer.writeString(2, this.code);
if (this.flip != false)
writer.writeBool(3, this.flip);
+ if (this.index != 0)
+ writer.writeInt32(4, this.index);
if (!w)
return writer.getResultBuffer();
}
- static deserialize(bytes: Uint8Array | pb_1.BinaryReader): SkpsSwitch {
- const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new SkpsSwitch();
+ static deserialize(bytes: Uint8Array | pb_1.BinaryReader): SpksSwitch {
+ const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new SpksSwitch();
while (reader.nextField()) {
if (reader.isEndGroup())
break;
@@ -3784,6 +3827,9 @@ export namespace graphicData {
case 3:
message.flip = reader.readBool();
break;
+ case 4:
+ message.index = reader.readInt32();
+ break;
default: reader.skipField();
}
}
@@ -3792,8 +3838,8 @@ export namespace graphicData {
serializeBinary(): Uint8Array {
return this.serialize();
}
- static deserializeBinary(bytes: Uint8Array): SkpsSwitch {
- return SkpsSwitch.deserialize(bytes);
+ static deserializeBinary(bytes: Uint8Array): SpksSwitch {
+ return SpksSwitch.deserialize(bytes);
}
}
export class EsbButton extends pb_1.Message {
@@ -3802,6 +3848,7 @@ export namespace graphicData {
common?: CommonInfo;
code?: string;
flip?: boolean;
+ index?: number;
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
@@ -3815,6 +3862,9 @@ export namespace graphicData {
if ("flip" in data && data.flip != undefined) {
this.flip = data.flip;
}
+ if ("index" in data && data.index != undefined) {
+ this.index = data.index;
+ }
}
}
get common() {
@@ -3838,10 +3888,17 @@ export namespace graphicData {
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);
+ }
static fromObject(data: {
common?: ReturnType;
code?: string;
flip?: boolean;
+ index?: number;
}): EsbButton {
const message = new EsbButton({});
if (data.common != null) {
@@ -3853,6 +3910,9 @@ export namespace graphicData {
if (data.flip != null) {
message.flip = data.flip;
}
+ if (data.index != null) {
+ message.index = data.index;
+ }
return message;
}
toObject() {
@@ -3860,6 +3920,7 @@ export namespace graphicData {
common?: ReturnType;
code?: string;
flip?: boolean;
+ index?: number;
} = {};
if (this.common != null) {
data.common = this.common.toObject();
@@ -3870,6 +3931,9 @@ export namespace graphicData {
if (this.flip != null) {
data.flip = this.flip;
}
+ if (this.index != null) {
+ data.index = this.index;
+ }
return data;
}
serialize(): Uint8Array;
@@ -3882,6 +3946,8 @@ export namespace graphicData {
writer.writeString(2, this.code);
if (this.flip != false)
writer.writeBool(3, this.flip);
+ if (this.index != 0)
+ writer.writeInt32(4, this.index);
if (!w)
return writer.getResultBuffer();
}
@@ -3900,6 +3966,9 @@ export namespace graphicData {
case 3:
message.flip = reader.readBool();
break;
+ case 4:
+ message.index = reader.readInt32();
+ break;
default: reader.skipField();
}
}
@@ -3918,6 +3987,7 @@ export namespace graphicData {
common?: CommonInfo;
code?: string;
flip?: boolean;
+ index?: number;
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
@@ -3931,6 +4001,9 @@ export namespace graphicData {
if ("flip" in data && data.flip != undefined) {
this.flip = data.flip;
}
+ if ("index" in data && data.index != undefined) {
+ this.index = data.index;
+ }
}
}
get common() {
@@ -3954,10 +4027,17 @@ export namespace graphicData {
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);
+ }
static fromObject(data: {
common?: ReturnType;
code?: string;
flip?: boolean;
+ index?: number;
}): GatedBox {
const message = new GatedBox({});
if (data.common != null) {
@@ -3969,6 +4049,9 @@ export namespace graphicData {
if (data.flip != null) {
message.flip = data.flip;
}
+ if (data.index != null) {
+ message.index = data.index;
+ }
return message;
}
toObject() {
@@ -3976,6 +4059,7 @@ export namespace graphicData {
common?: ReturnType;
code?: string;
flip?: boolean;
+ index?: number;
} = {};
if (this.common != null) {
data.common = this.common.toObject();
@@ -3986,6 +4070,9 @@ export namespace graphicData {
if (this.flip != null) {
data.flip = this.flip;
}
+ if (this.index != null) {
+ data.index = this.index;
+ }
return data;
}
serialize(): Uint8Array;
@@ -3998,6 +4085,8 @@ export namespace graphicData {
writer.writeString(2, this.code);
if (this.flip != false)
writer.writeBool(3, this.flip);
+ if (this.index != 0)
+ writer.writeInt32(4, this.index);
if (!w)
return writer.getResultBuffer();
}
@@ -4016,6 +4105,9 @@ export namespace graphicData {
case 3:
message.flip = reader.readBool();
break;
+ case 4:
+ message.index = reader.readInt32();
+ break;
default: reader.skipField();
}
}