运行线代码提交
This commit is contained in:
parent
9ca21665cf
commit
ace323100d
@ -63,6 +63,9 @@
|
||||
<TurnoutProperty
|
||||
v-else-if="drawStore.selectedGraphicType === Turnout.Type"
|
||||
></TurnoutProperty>
|
||||
<run-line-property
|
||||
v-else-if="drawStore.selectedGraphicType === RunLine.Type"
|
||||
></run-line-property>
|
||||
</q-card-section>
|
||||
</template>
|
||||
</q-card>
|
||||
@ -84,6 +87,7 @@ import TrainProperty from './properties/TrainProperty.vue';
|
||||
import IscsFanProperty from './properties/IscsFanProperty.vue';
|
||||
import SignalProperty from './properties/SignalProperty.vue';
|
||||
import TurnoutProperty from './properties/TurnoutProperty.vue';
|
||||
import RunLineProperty from './properties/RunLineProperty.vue';
|
||||
import { Link } from 'src/graphics/link/Link';
|
||||
import { Rect } from 'src/graphics/rect/Rect';
|
||||
import { Platform } from 'src/graphics/platform/Platform';
|
||||
@ -93,6 +97,7 @@ import { useDrawStore } from 'src/stores/draw-store';
|
||||
import { IscsFan } from 'src/graphics/iscs-fan/IscsFan';
|
||||
import { Signal } from 'src/graphics/signal/Signal';
|
||||
import { Turnout } from 'src/graphics/turnout/Turnout';
|
||||
import { RunLine } from 'src/graphics/runLine/RunLine';
|
||||
|
||||
const drawStore = useDrawStore();
|
||||
</script>
|
||||
|
93
src/components/draw-app/properties/RunLineProperty.vue
Normal file
93
src/components/draw-app/properties/RunLineProperty.vue
Normal file
@ -0,0 +1,93 @@
|
||||
<template>
|
||||
<q-form>
|
||||
<q-input outlined readonly v-model="runLineModel.id" label="id" hint="" />
|
||||
<q-input
|
||||
outlined
|
||||
v-model.number="runLineModel.code"
|
||||
@blur="onUpdate"
|
||||
label="名称"
|
||||
/>
|
||||
<q-input
|
||||
outlined
|
||||
v-model="runLineModel.nameColor"
|
||||
@blur="onUpdate"
|
||||
label="名称颜色"
|
||||
lazy-rules
|
||||
:rules="[(val) => (val && val.length > 0) || '名称颜色不能为空']"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="colorize" class="cursor-pointer">
|
||||
<q-popup-proxy cover transition-show="scale" transition-hide="scale">
|
||||
<q-color
|
||||
v-model="runLineModel.nameColor"
|
||||
@change="
|
||||
(val) => {
|
||||
runLineModel.nameColor = val;
|
||||
onUpdate();
|
||||
}
|
||||
"
|
||||
/>
|
||||
</q-popup-proxy>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
<q-input
|
||||
outlined
|
||||
v-model="runLineModel.nameBgColor"
|
||||
@blur="onUpdate"
|
||||
label="名称背景色"
|
||||
lazy-rules
|
||||
:rules="[(val) => (val && val.length > 0) || '名称背景色不能为空']"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="colorize" class="cursor-pointer">
|
||||
<q-popup-proxy cover transition-show="scale" transition-hide="scale">
|
||||
<q-color
|
||||
v-model="runLineModel.nameBgColor"
|
||||
@change="
|
||||
(val) => {
|
||||
runLineModel.nameBgColor = val;
|
||||
onUpdate();
|
||||
}
|
||||
"
|
||||
/>
|
||||
</q-popup-proxy>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</q-form>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { RunLineData } from 'src/drawApp/graphics/RunLineInteraction';
|
||||
import { RunLine } from 'src/graphics/runLine/RunLine';
|
||||
import { useDrawStore } from 'src/stores/draw-store';
|
||||
import { onMounted, reactive, watch } from 'vue';
|
||||
|
||||
const drawStore = useDrawStore();
|
||||
const runLineModel = reactive(new RunLineData());
|
||||
|
||||
drawStore.$subscribe;
|
||||
watch(
|
||||
() => drawStore.selectedGraphic,
|
||||
(val) => {
|
||||
if (val && val.type == RunLine.Type) {
|
||||
runLineModel.copyFrom(val.saveData() as RunLineData);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
onMounted(() => {
|
||||
const runLine = drawStore.selectedGraphic as RunLine;
|
||||
if (runLine) {
|
||||
runLineModel.copyFrom(runLine.saveData());
|
||||
}
|
||||
});
|
||||
|
||||
function onUpdate() {
|
||||
const runLine = drawStore.selectedGraphic as RunLine;
|
||||
if (runLine) {
|
||||
drawStore.getDrawApp().updateGraphicAndRecord(runLine, runLineModel);
|
||||
}
|
||||
}
|
||||
</script>
|
58
src/drawApp/graphics/RunLineInteraction.ts
Normal file
58
src/drawApp/graphics/RunLineInteraction.ts
Normal file
@ -0,0 +1,58 @@
|
||||
import * as pb_1 from 'google-protobuf';
|
||||
import { IRunLineData } from 'src/graphics/runLine/RunLine';
|
||||
import { graphicData } from 'src/protos/stationLayoutGraphics';
|
||||
import { GraphicDataBase } from './GraphicDataBase';
|
||||
import { IPointData } from 'pixi.js';
|
||||
|
||||
export class RunLineData extends GraphicDataBase implements IRunLineData {
|
||||
constructor(data?: graphicData.RunLine) {
|
||||
let RunLine;
|
||||
if (!data) {
|
||||
RunLine = new graphicData.RunLine({
|
||||
common: GraphicDataBase.defaultCommonInfo(),
|
||||
});
|
||||
} else {
|
||||
RunLine = data;
|
||||
}
|
||||
RunLine.common.graphicType = 'RunLine';
|
||||
super(RunLine);
|
||||
}
|
||||
public get data(): graphicData.RunLine {
|
||||
return this.getData<graphicData.RunLine>();
|
||||
}
|
||||
get code(): string {
|
||||
return this.data.code;
|
||||
}
|
||||
set code(v: string) {
|
||||
this.data.code = v;
|
||||
}
|
||||
get points(): IPointData[] {
|
||||
return this.data.points;
|
||||
}
|
||||
set points(points: IPointData[]) {
|
||||
this.data.points = points.map(
|
||||
(p) => new graphicData.Point({ x: p.x, y: p.y })
|
||||
);
|
||||
}
|
||||
get nameColor(): string {
|
||||
return this.data.nameColor;
|
||||
}
|
||||
set nameColor(v: string) {
|
||||
this.data.nameColor = v;
|
||||
}
|
||||
get nameBgColor(): string {
|
||||
return this.data.nameBgColor;
|
||||
}
|
||||
set nameBgColor(v: string) {
|
||||
this.data.nameBgColor = v;
|
||||
}
|
||||
clone(): RunLineData {
|
||||
return new RunLineData(this.data.cloneMessage());
|
||||
}
|
||||
copyFrom(data: RunLineData): void {
|
||||
pb_1.Message.copyInto(data.data, this.data);
|
||||
}
|
||||
eq(other: RunLineData): boolean {
|
||||
return pb_1.Message.equals(this.data, other.data);
|
||||
}
|
||||
}
|
@ -34,6 +34,9 @@ import { graphicData } from 'src/protos/stationLayoutGraphics';
|
||||
import { Turnout } from 'src/graphics/turnout/Turnout';
|
||||
import { TurnoutDraw } from 'src/graphics/turnout/TurnoutDrawAssistant';
|
||||
import { TurnoutData } from './graphics/TurnoutInteraction';
|
||||
import { RunLine } from 'src/graphics/runLine/RunLine';
|
||||
import { RunLineDraw } from 'src/graphics/runLine/RunLineDrawAssistant';
|
||||
import { RunLineData } from './graphics/RunLineInteraction';
|
||||
import { saveDraft, getDraft } from 'src/api/DraftApi';
|
||||
import { useDrawStore } from 'src/stores/draw-store';
|
||||
import { successNotify, errorNotify } from '../utils/CommonNotify';
|
||||
@ -113,6 +116,7 @@ export function initDrawApp(dom: HTMLElement): JlDrawApp {
|
||||
| StationDraw
|
||||
| SignalDraw
|
||||
| TurnoutDraw
|
||||
| RunLineDraw
|
||||
)[] = [];
|
||||
if (draftType === 'Line') {
|
||||
drawAssistants = [
|
||||
@ -128,6 +132,9 @@ export function initDrawApp(dom: HTMLElement): JlDrawApp {
|
||||
new TurnoutDraw(app, () => {
|
||||
return new TurnoutData();
|
||||
}),
|
||||
new RunLineDraw(app, () => {
|
||||
return new RunLineData();
|
||||
}),
|
||||
// new TrainDraw(app, () => {
|
||||
// return new TrainData();
|
||||
// }),
|
||||
@ -165,6 +172,14 @@ export function initDrawApp(dom: HTMLElement): JlDrawApp {
|
||||
},
|
||||
})
|
||||
);
|
||||
app.addKeyboardListener(
|
||||
new KeyListener({
|
||||
value: 'KeyR',
|
||||
onPress: () => {
|
||||
app.interactionPlugin(RunLine.Type).resume();
|
||||
},
|
||||
})
|
||||
);
|
||||
// app.addKeyboardListener(
|
||||
// new KeyListener({
|
||||
// value: 'KeyR',
|
||||
@ -259,6 +274,9 @@ export function saveDrawDatas(app: JlDrawApp) {
|
||||
} else if (Signal.Type === g.type) {
|
||||
const signalData = (g as Signal).saveData();
|
||||
storage.signals.push((signalData as SignalData).data);
|
||||
} else if (RunLine.Type === g.type) {
|
||||
const runLineData = (g as RunLine).saveData();
|
||||
storage.runLines.push((runLineData as RunLineData).data);
|
||||
}
|
||||
});
|
||||
const base64 = fromUint8Array(storage.serialize());
|
||||
@ -308,6 +326,9 @@ export async function loadDrawDatas(app: GraphicApp) {
|
||||
storage.signals.forEach((signal) => {
|
||||
datas.push(new SignalData(signal));
|
||||
});
|
||||
storage.runLines.forEach((runLine) => {
|
||||
datas.push(new RunLineData(runLine));
|
||||
});
|
||||
app.loadGraphic(datas);
|
||||
} else {
|
||||
app.loadGraphic([]);
|
||||
|
103
src/graphics/runLine/RunLine.ts
Normal file
103
src/graphics/runLine/RunLine.ts
Normal file
@ -0,0 +1,103 @@
|
||||
import { Graphics, IPointData, LINE_JOIN } from 'pixi.js';
|
||||
import { GraphicData, JlGraphic, JlGraphicTemplate } from 'src/jl-graphic';
|
||||
import { RunLineName } from './RunLineName';
|
||||
|
||||
export interface IRunLineData extends GraphicData {
|
||||
get code(): string;
|
||||
set code(v: string);
|
||||
get points(): IPointData[]; // 线坐标点
|
||||
set points(points: IPointData[]);
|
||||
get nameColor(): string;
|
||||
set nameColor(v: string);
|
||||
get nameBgColor(): string;
|
||||
set nameBgColor(v: string);
|
||||
clone(): IRunLineData;
|
||||
copyFrom(data: IRunLineData): void;
|
||||
eq(other: IRunLineData): boolean;
|
||||
}
|
||||
|
||||
export enum RunLineColorEnum {
|
||||
runLineColor = '0XC1F467',
|
||||
}
|
||||
|
||||
export const runLineConsts = {
|
||||
runLineWidth: 6,
|
||||
nameFontSize: 16,
|
||||
nameOffsetX: 40,
|
||||
};
|
||||
|
||||
export class RunLine extends JlGraphic {
|
||||
static Type = 'RunLine';
|
||||
lineBody: Graphics = new Graphics();
|
||||
leftRunLineName: RunLineName = new RunLineName();
|
||||
rightRunLineName: RunLineName = new RunLineName();
|
||||
|
||||
constructor() {
|
||||
super(RunLine.Type);
|
||||
this.leftRunLineName.name = 'leftRunLineName';
|
||||
this.rightRunLineName.name = 'rightRunLineName';
|
||||
this.addChild(this.lineBody);
|
||||
this.addChild(this.leftRunLineName);
|
||||
this.addChild(this.rightRunLineName);
|
||||
}
|
||||
get datas(): IRunLineData {
|
||||
return this.getDatas<IRunLineData>();
|
||||
}
|
||||
|
||||
doRepaint(): void {
|
||||
if (this.datas.points.length < 2) {
|
||||
throw new Error('RunLine坐标数据异常');
|
||||
}
|
||||
this.lineBody.clear();
|
||||
this.lineBody.lineStyle({
|
||||
width: runLineConsts.runLineWidth,
|
||||
color: RunLineColorEnum.runLineColor,
|
||||
join: LINE_JOIN.ROUND,
|
||||
});
|
||||
const start = this.getStartPoint();
|
||||
this.lineBody.moveTo(start.x, start.y);
|
||||
for (let i = 0; i < this.datas.points.length; i++) {
|
||||
const p = this.datas.points[i];
|
||||
this.lineBody.lineTo(p.x, p.y);
|
||||
}
|
||||
|
||||
this.leftRunLineName.paint(
|
||||
this.getStartPoint().x - runLineConsts.nameOffsetX,
|
||||
this.getStartPoint().y,
|
||||
this.datas
|
||||
);
|
||||
|
||||
this.rightRunLineName.paint(
|
||||
this.getEndPoint().x + runLineConsts.nameOffsetX,
|
||||
this.getEndPoint().y,
|
||||
this.datas
|
||||
);
|
||||
}
|
||||
get linePoints(): IPointData[] {
|
||||
return this.datas.points;
|
||||
}
|
||||
set linePoints(points: IPointData[]) {
|
||||
const old = this.datas.clone();
|
||||
old.points = points;
|
||||
this.updateData(old);
|
||||
}
|
||||
getStartPoint(): IPointData {
|
||||
return this.datas.points[0];
|
||||
}
|
||||
getEndPoint(): IPointData {
|
||||
return this.datas.points[this.datas.points.length - 1];
|
||||
}
|
||||
}
|
||||
|
||||
export class RunLineTemplate extends JlGraphicTemplate<RunLine> {
|
||||
runLineColor: string;
|
||||
runLineWidth: number;
|
||||
constructor() {
|
||||
super(RunLine.Type);
|
||||
this.runLineColor = RunLineColorEnum.runLineColor;
|
||||
this.runLineWidth = runLineConsts.runLineWidth;
|
||||
}
|
||||
new(): RunLine {
|
||||
return new RunLine();
|
||||
}
|
||||
}
|
215
src/graphics/runLine/RunLineDrawAssistant.ts
Normal file
215
src/graphics/runLine/RunLineDrawAssistant.ts
Normal file
@ -0,0 +1,215 @@
|
||||
import {
|
||||
GraphicDrawAssistant,
|
||||
JlDrawApp,
|
||||
JlGraphic,
|
||||
GraphicInteractionPlugin,
|
||||
linePoint,
|
||||
GraphicApp,
|
||||
} from 'src/jl-graphic';
|
||||
import {
|
||||
IRunLineData,
|
||||
RunLine,
|
||||
RunLineTemplate,
|
||||
runLineConsts,
|
||||
} from './RunLine';
|
||||
import {
|
||||
PolylineEditPlugin,
|
||||
addWayPoint,
|
||||
addWaypointConfig,
|
||||
clearWayPoint,
|
||||
clearWaypointsConfig,
|
||||
getWaypointRangeIndex,
|
||||
} from 'src/jl-graphic/plugins/GraphicEditPlugin';
|
||||
import {
|
||||
FederatedPointerEvent,
|
||||
Point,
|
||||
Graphics,
|
||||
LINE_JOIN,
|
||||
IHitArea,
|
||||
DisplayObject,
|
||||
FederatedMouseEvent,
|
||||
} from 'pixi.js';
|
||||
import { ContextMenu } from 'src/jl-graphic/ui/ContextMenu';
|
||||
|
||||
export interface IRunLineDrawOptions {
|
||||
newData: () => IRunLineData;
|
||||
}
|
||||
|
||||
export class RunLineDraw extends GraphicDrawAssistant<
|
||||
RunLineTemplate,
|
||||
IRunLineData
|
||||
> {
|
||||
points: Point[] = [];
|
||||
graphic: Graphics = new Graphics();
|
||||
|
||||
constructor(app: JlDrawApp, createData: () => IRunLineData) {
|
||||
super(
|
||||
app,
|
||||
new RunLineTemplate(),
|
||||
createData,
|
||||
'svguse:/drawIcon.svg#icon-signal',
|
||||
'运行线RunLIne'
|
||||
);
|
||||
this.container.addChild(this.graphic);
|
||||
RunLinePointsEditPlugin.init(app);
|
||||
}
|
||||
|
||||
bind(): void {
|
||||
super.bind();
|
||||
}
|
||||
unbind(): void {
|
||||
super.unbind();
|
||||
}
|
||||
clearCache(): void {
|
||||
this.points = [];
|
||||
this.graphic.clear();
|
||||
}
|
||||
onRightClick(): void {
|
||||
this.createAndStore(true);
|
||||
}
|
||||
onLeftDown(e: FederatedPointerEvent): void {
|
||||
const { x, y } = this.toCanvasCoordinates(e.global);
|
||||
const p = new Point(x, y);
|
||||
this.points.push(p);
|
||||
}
|
||||
redraw(p: Point): void {
|
||||
if (this.points.length < 1) return;
|
||||
this.graphic.clear();
|
||||
const template = this.graphicTemplate;
|
||||
this.graphic.lineStyle({
|
||||
width: template.runLineWidth,
|
||||
color: template.runLineColor,
|
||||
join: LINE_JOIN.ROUND,
|
||||
});
|
||||
const ps = [...this.points];
|
||||
ps.push(p);
|
||||
// 直线
|
||||
this.graphic.moveTo(ps[0].x, ps[0].y);
|
||||
for (let i = 1; i < ps.length; i++) {
|
||||
const p = ps[i];
|
||||
this.graphic.lineTo(p.x, p.y);
|
||||
}
|
||||
}
|
||||
prepareData(data: IRunLineData): boolean {
|
||||
data.points = this.points;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
export class RunLineGraphicHitArea implements IHitArea {
|
||||
runLine: RunLine;
|
||||
constructor(runLine: RunLine) {
|
||||
this.runLine = runLine;
|
||||
}
|
||||
contains(x: number, y: number): boolean {
|
||||
const p = new Point(x, y);
|
||||
for (let i = 1; i < this.runLine.datas.points.length; i++) {
|
||||
const p1 = this.runLine.datas.points[i - 1];
|
||||
const p2 = this.runLine.datas.points[i];
|
||||
if (linePoint(p1, p2, p, runLineConsts.runLineWidth)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
const RunLineEditMenu: ContextMenu = ContextMenu.init({
|
||||
name: '运行线编辑菜单',
|
||||
groups: [
|
||||
{
|
||||
items: [addWaypointConfig, clearWaypointsConfig],
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
export class RunLinePointsEditPlugin extends GraphicInteractionPlugin<RunLine> {
|
||||
static Name = 'LinkPointsDrag';
|
||||
constructor(app: GraphicApp) {
|
||||
super(RunLinePointsEditPlugin.Name, app);
|
||||
app.registerMenu(RunLineEditMenu);
|
||||
}
|
||||
static init(app: GraphicApp): RunLinePointsEditPlugin {
|
||||
return new RunLinePointsEditPlugin(app);
|
||||
}
|
||||
filter(...grahpics: JlGraphic[]): RunLine[] | undefined {
|
||||
return grahpics.filter((g) => g.type == RunLine.Type) as RunLine[];
|
||||
}
|
||||
bind(g: RunLine): void {
|
||||
g.lineBody.eventMode = 'static';
|
||||
g.lineBody.cursor = 'pointer';
|
||||
g.leftRunLineName.draggable = true;
|
||||
g.leftRunLineName.selectable = true;
|
||||
g.leftRunLineName.rotatable = true;
|
||||
g.leftRunLineName.transformSave = true;
|
||||
g.leftRunLineName.eventMode = 'static';
|
||||
g.leftRunLineName.cursor = 'pointer';
|
||||
|
||||
g.rightRunLineName.draggable = true;
|
||||
g.rightRunLineName.selectable = true;
|
||||
g.rightRunLineName.rotatable = true;
|
||||
g.rightRunLineName.transformSave = true;
|
||||
g.rightRunLineName.eventMode = 'static';
|
||||
g.rightRunLineName.cursor = 'pointer';
|
||||
g.lineBody.hitArea = new RunLineGraphicHitArea(g);
|
||||
g.on('_rightclick', this.onContextMenu, this);
|
||||
g.on('selected', this.onSelected, this);
|
||||
g.on('unselected', this.onUnselected, this);
|
||||
}
|
||||
unbind(g: RunLine): void {
|
||||
g.leftRunLineName.draggable = false;
|
||||
g.leftRunLineName.selectable = false;
|
||||
g.leftRunLineName.rotatable = false;
|
||||
g.leftRunLineName.transformSave = false;
|
||||
g.leftRunLineName.eventMode = 'none';
|
||||
|
||||
g.rightRunLineName.draggable = false;
|
||||
g.rightRunLineName.selectable = false;
|
||||
g.rightRunLineName.rotatable = false;
|
||||
g.rightRunLineName.transformSave = false;
|
||||
g.rightRunLineName.eventMode = 'none';
|
||||
|
||||
g.off('_rightclick', this.onContextMenu, this);
|
||||
g.off('selected', this.onSelected, this);
|
||||
g.off('unselected', this.onUnselected, this);
|
||||
}
|
||||
|
||||
onContextMenu(e: FederatedMouseEvent) {
|
||||
const target = e.target as DisplayObject;
|
||||
const runLine = target.getGraphic() as RunLine;
|
||||
this.app.updateSelected(runLine);
|
||||
|
||||
addWaypointConfig.handler = () => {
|
||||
const linePoints = runLine.linePoints;
|
||||
const p = runLine.screenToLocalPoint(e.global);
|
||||
const { start, end } = getWaypointRangeIndex(linePoints, false, p);
|
||||
addWayPoint(runLine, false, start, end, p);
|
||||
};
|
||||
clearWaypointsConfig.handler = () => {
|
||||
clearWayPoint(runLine, false);
|
||||
};
|
||||
RunLineEditMenu.open(e.global);
|
||||
}
|
||||
|
||||
onSelected(g: DisplayObject): void {
|
||||
const runLine = g as RunLine;
|
||||
let lep;
|
||||
lep = runLine.getAssistantAppend<PolylineEditPlugin>(
|
||||
PolylineEditPlugin.Name
|
||||
);
|
||||
if (!lep) {
|
||||
lep = new PolylineEditPlugin(runLine);
|
||||
runLine.addAssistantAppend(lep);
|
||||
}
|
||||
lep.showAll();
|
||||
}
|
||||
onUnselected(g: DisplayObject): void {
|
||||
const runLine = g as RunLine;
|
||||
const lep = runLine.getAssistantAppend<PolylineEditPlugin>(
|
||||
PolylineEditPlugin.Name
|
||||
);
|
||||
if (lep) {
|
||||
lep.hideAll();
|
||||
}
|
||||
}
|
||||
}
|
46
src/graphics/runLine/RunLineName.ts
Normal file
46
src/graphics/runLine/RunLineName.ts
Normal file
@ -0,0 +1,46 @@
|
||||
import { Container } from '@pixi/display';
|
||||
import { Graphics } from 'pixi.js';
|
||||
import { VectorText } from 'src/jl-graphic';
|
||||
import { IRunLineData } from './RunLine';
|
||||
|
||||
const nameConsts = {
|
||||
padding: 8,
|
||||
nameFontSize: 16,
|
||||
defaultNameColor: '0X000000',
|
||||
defaultBgColor: '0X0ff000',
|
||||
bgRadius: 6,
|
||||
};
|
||||
|
||||
export class RunLineName extends Container {
|
||||
nameBg: Graphics = new Graphics();
|
||||
runLineName: VectorText = new VectorText();
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this.addChild(this.nameBg);
|
||||
this.addChild(this.runLineName);
|
||||
}
|
||||
paint(x: number, y: number, data: IRunLineData) {
|
||||
this.runLineName.text = data.code || '运行线';
|
||||
this.runLineName.style.fill = data.nameColor || nameConsts.defaultNameColor;
|
||||
this.runLineName.setVectorFontSize(nameConsts.nameFontSize);
|
||||
this.runLineName.anchor.set(0.5);
|
||||
this.runLineName.position.set(x, y);
|
||||
|
||||
const nameRect = this.runLineName.getLocalBounds();
|
||||
this.nameBg.clear();
|
||||
if (!this.nameBg.drawRoundedRect) {
|
||||
return;
|
||||
}
|
||||
this.nameBg.beginFill(data.nameBgColor || nameConsts.defaultBgColor, 1);
|
||||
this.nameBg
|
||||
.drawRoundedRect(
|
||||
nameRect.x - nameConsts.padding / 2 + x,
|
||||
nameRect.y - nameConsts.padding / 2 + y,
|
||||
nameRect.width + nameConsts.padding,
|
||||
nameRect.height + nameConsts.padding,
|
||||
nameConsts.bgRadius
|
||||
)
|
||||
.endFill();
|
||||
}
|
||||
}
|
@ -8,14 +8,13 @@ export class LineNetTrainOffset extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
lineId?: number;
|
||||
Group_id?: string;
|
||||
groupId?: string;
|
||||
dir?: number;
|
||||
initType?: boolean;
|
||||
offset?: number;
|
||||
destinationId?: number;
|
||||
backId?: number;
|
||||
show?: boolean;
|
||||
rate?: number;
|
||||
windowNo?: number;
|
||||
windowOffset?: number;
|
||||
destinationId?: string;
|
||||
backId?: string;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||
@ -23,17 +22,20 @@ export class LineNetTrainOffset extends pb_1.Message {
|
||||
if ("lineId" in data && data.lineId != undefined) {
|
||||
this.lineId = data.lineId;
|
||||
}
|
||||
if ("Group_id" in data && data.Group_id != undefined) {
|
||||
this.Group_id = data.Group_id;
|
||||
if ("groupId" in data && data.groupId != undefined) {
|
||||
this.groupId = data.groupId;
|
||||
}
|
||||
if ("dir" in data && data.dir != undefined) {
|
||||
this.dir = data.dir;
|
||||
}
|
||||
if ("initType" in data && data.initType != undefined) {
|
||||
this.initType = data.initType;
|
||||
if ("show" in data && data.show != undefined) {
|
||||
this.show = data.show;
|
||||
}
|
||||
if ("offset" in data && data.offset != undefined) {
|
||||
this.offset = data.offset;
|
||||
if ("windowNo" in data && data.windowNo != undefined) {
|
||||
this.windowNo = data.windowNo;
|
||||
}
|
||||
if ("windowOffset" in data && data.windowOffset != undefined) {
|
||||
this.windowOffset = data.windowOffset;
|
||||
}
|
||||
if ("destinationId" in data && data.destinationId != undefined) {
|
||||
this.destinationId = data.destinationId;
|
||||
@ -41,12 +43,6 @@ export class LineNetTrainOffset extends pb_1.Message {
|
||||
if ("backId" in data && data.backId != undefined) {
|
||||
this.backId = data.backId;
|
||||
}
|
||||
if ("show" in data && data.show != undefined) {
|
||||
this.show = data.show;
|
||||
}
|
||||
if ("rate" in data && data.rate != undefined) {
|
||||
this.rate = data.rate;
|
||||
}
|
||||
}
|
||||
}
|
||||
get lineId() {
|
||||
@ -55,10 +51,10 @@ export class LineNetTrainOffset extends pb_1.Message {
|
||||
set lineId(value: number) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
get Group_id() {
|
||||
get groupId() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
|
||||
}
|
||||
set Group_id(value: string) {
|
||||
set groupId(value: string) {
|
||||
pb_1.Message.setField(this, 2, value);
|
||||
}
|
||||
get dir() {
|
||||
@ -67,68 +63,64 @@ export class LineNetTrainOffset extends pb_1.Message {
|
||||
set dir(value: number) {
|
||||
pb_1.Message.setField(this, 3, value);
|
||||
}
|
||||
get initType() {
|
||||
get show() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 4, false) as boolean;
|
||||
}
|
||||
set initType(value: boolean) {
|
||||
set show(value: boolean) {
|
||||
pb_1.Message.setField(this, 4, value);
|
||||
}
|
||||
get offset() {
|
||||
get windowNo() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 5, 0) as number;
|
||||
}
|
||||
set offset(value: number) {
|
||||
set windowNo(value: number) {
|
||||
pb_1.Message.setField(this, 5, value);
|
||||
}
|
||||
get destinationId() {
|
||||
get windowOffset() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 6, 0) as number;
|
||||
}
|
||||
set destinationId(value: number) {
|
||||
set windowOffset(value: number) {
|
||||
pb_1.Message.setField(this, 6, value);
|
||||
}
|
||||
get backId() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 7, 0) as number;
|
||||
get destinationId() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 7, "") as string;
|
||||
}
|
||||
set backId(value: number) {
|
||||
set destinationId(value: string) {
|
||||
pb_1.Message.setField(this, 7, value);
|
||||
}
|
||||
get show() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 8, false) as boolean;
|
||||
get backId() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 8, "") as string;
|
||||
}
|
||||
set show(value: boolean) {
|
||||
set backId(value: string) {
|
||||
pb_1.Message.setField(this, 8, value);
|
||||
}
|
||||
get rate() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 9, 0) as number;
|
||||
}
|
||||
set rate(value: number) {
|
||||
pb_1.Message.setField(this, 9, value);
|
||||
}
|
||||
static fromObject(data: {
|
||||
lineId?: number;
|
||||
Group_id?: string;
|
||||
groupId?: string;
|
||||
dir?: number;
|
||||
initType?: boolean;
|
||||
offset?: number;
|
||||
destinationId?: number;
|
||||
backId?: number;
|
||||
show?: boolean;
|
||||
rate?: number;
|
||||
windowNo?: number;
|
||||
windowOffset?: number;
|
||||
destinationId?: string;
|
||||
backId?: string;
|
||||
}): LineNetTrainOffset {
|
||||
const message = new LineNetTrainOffset({});
|
||||
if (data.lineId != null) {
|
||||
message.lineId = data.lineId;
|
||||
}
|
||||
if (data.Group_id != null) {
|
||||
message.Group_id = data.Group_id;
|
||||
if (data.groupId != null) {
|
||||
message.groupId = data.groupId;
|
||||
}
|
||||
if (data.dir != null) {
|
||||
message.dir = data.dir;
|
||||
}
|
||||
if (data.initType != null) {
|
||||
message.initType = data.initType;
|
||||
if (data.show != null) {
|
||||
message.show = data.show;
|
||||
}
|
||||
if (data.offset != null) {
|
||||
message.offset = data.offset;
|
||||
if (data.windowNo != null) {
|
||||
message.windowNo = data.windowNo;
|
||||
}
|
||||
if (data.windowOffset != null) {
|
||||
message.windowOffset = data.windowOffset;
|
||||
}
|
||||
if (data.destinationId != null) {
|
||||
message.destinationId = data.destinationId;
|
||||
@ -136,40 +128,36 @@ export class LineNetTrainOffset extends pb_1.Message {
|
||||
if (data.backId != null) {
|
||||
message.backId = data.backId;
|
||||
}
|
||||
if (data.show != null) {
|
||||
message.show = data.show;
|
||||
}
|
||||
if (data.rate != null) {
|
||||
message.rate = data.rate;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {
|
||||
lineId?: number;
|
||||
Group_id?: string;
|
||||
groupId?: string;
|
||||
dir?: number;
|
||||
initType?: boolean;
|
||||
offset?: number;
|
||||
destinationId?: number;
|
||||
backId?: number;
|
||||
show?: boolean;
|
||||
rate?: number;
|
||||
windowNo?: number;
|
||||
windowOffset?: number;
|
||||
destinationId?: string;
|
||||
backId?: string;
|
||||
} = {};
|
||||
if (this.lineId != null) {
|
||||
data.lineId = this.lineId;
|
||||
}
|
||||
if (this.Group_id != null) {
|
||||
data.Group_id = this.Group_id;
|
||||
if (this.groupId != null) {
|
||||
data.groupId = this.groupId;
|
||||
}
|
||||
if (this.dir != null) {
|
||||
data.dir = this.dir;
|
||||
}
|
||||
if (this.initType != null) {
|
||||
data.initType = this.initType;
|
||||
if (this.show != null) {
|
||||
data.show = this.show;
|
||||
}
|
||||
if (this.offset != null) {
|
||||
data.offset = this.offset;
|
||||
if (this.windowNo != null) {
|
||||
data.windowNo = this.windowNo;
|
||||
}
|
||||
if (this.windowOffset != null) {
|
||||
data.windowOffset = this.windowOffset;
|
||||
}
|
||||
if (this.destinationId != null) {
|
||||
data.destinationId = this.destinationId;
|
||||
@ -177,12 +165,6 @@ export class LineNetTrainOffset extends pb_1.Message {
|
||||
if (this.backId != null) {
|
||||
data.backId = this.backId;
|
||||
}
|
||||
if (this.show != null) {
|
||||
data.show = this.show;
|
||||
}
|
||||
if (this.rate != null) {
|
||||
data.rate = this.rate;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
@ -191,22 +173,20 @@ export class LineNetTrainOffset extends pb_1.Message {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.lineId != 0)
|
||||
writer.writeInt32(1, this.lineId);
|
||||
if (this.Group_id.length)
|
||||
writer.writeString(2, this.Group_id);
|
||||
if (this.groupId.length)
|
||||
writer.writeString(2, this.groupId);
|
||||
if (this.dir != 0)
|
||||
writer.writeInt32(3, this.dir);
|
||||
if (this.initType != false)
|
||||
writer.writeBool(4, this.initType);
|
||||
if (this.offset != 0)
|
||||
writer.writeInt32(5, this.offset);
|
||||
if (this.destinationId != 0)
|
||||
writer.writeInt32(6, this.destinationId);
|
||||
if (this.backId != 0)
|
||||
writer.writeInt32(7, this.backId);
|
||||
if (this.show != false)
|
||||
writer.writeBool(8, this.show);
|
||||
if (this.rate != 0)
|
||||
writer.writeFloat(9, this.rate);
|
||||
writer.writeBool(4, this.show);
|
||||
if (this.windowNo != 0)
|
||||
writer.writeInt32(5, this.windowNo);
|
||||
if (this.windowOffset != 0)
|
||||
writer.writeInt32(6, this.windowOffset);
|
||||
if (this.destinationId.length)
|
||||
writer.writeString(7, this.destinationId);
|
||||
if (this.backId.length)
|
||||
writer.writeString(8, this.backId);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
@ -220,28 +200,25 @@ export class LineNetTrainOffset extends pb_1.Message {
|
||||
message.lineId = reader.readInt32();
|
||||
break;
|
||||
case 2:
|
||||
message.Group_id = reader.readString();
|
||||
message.groupId = reader.readString();
|
||||
break;
|
||||
case 3:
|
||||
message.dir = reader.readInt32();
|
||||
break;
|
||||
case 4:
|
||||
message.initType = reader.readBool();
|
||||
break;
|
||||
case 5:
|
||||
message.offset = reader.readInt32();
|
||||
break;
|
||||
case 6:
|
||||
message.destinationId = reader.readInt32();
|
||||
break;
|
||||
case 7:
|
||||
message.backId = reader.readInt32();
|
||||
break;
|
||||
case 8:
|
||||
message.show = reader.readBool();
|
||||
break;
|
||||
case 9:
|
||||
message.rate = reader.readFloat();
|
||||
case 5:
|
||||
message.windowNo = reader.readInt32();
|
||||
break;
|
||||
case 6:
|
||||
message.windowOffset = reader.readInt32();
|
||||
break;
|
||||
case 7:
|
||||
message.destinationId = reader.readString();
|
||||
break;
|
||||
case 8:
|
||||
message.backId = reader.readString();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
|
@ -1546,6 +1546,7 @@ export namespace state {
|
||||
ipSingleSwitchStusBlocked2?: boolean;
|
||||
ipSingleSwitchStusLostIndication?: boolean;
|
||||
id?: string;
|
||||
speedLimit?: number;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||
@ -1634,6 +1635,9 @@ export namespace state {
|
||||
if ("id" in data && data.id != undefined) {
|
||||
this.id = data.id;
|
||||
}
|
||||
if ("speedLimit" in data && data.speedLimit != undefined) {
|
||||
this.speedLimit = data.speedLimit;
|
||||
}
|
||||
}
|
||||
}
|
||||
get ipSingleSwitchStusCiOccupied() {
|
||||
@ -1804,6 +1808,12 @@ export namespace state {
|
||||
set id(value: string) {
|
||||
pb_1.Message.setField(this, 28, value);
|
||||
}
|
||||
get speedLimit() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 29, 0) as number;
|
||||
}
|
||||
set speedLimit(value: number) {
|
||||
pb_1.Message.setField(this, 29, value);
|
||||
}
|
||||
static fromObject(data: {
|
||||
ipSingleSwitchStusCiOccupied?: boolean;
|
||||
ipSingleSwitchStusCbtcOccupied?: boolean;
|
||||
@ -1833,6 +1843,7 @@ export namespace state {
|
||||
ipSingleSwitchStusBlocked2?: boolean;
|
||||
ipSingleSwitchStusLostIndication?: boolean;
|
||||
id?: string;
|
||||
speedLimit?: number;
|
||||
}): Switch {
|
||||
const message = new Switch({});
|
||||
if (data.ipSingleSwitchStusCiOccupied != null) {
|
||||
@ -1919,6 +1930,9 @@ export namespace state {
|
||||
if (data.id != null) {
|
||||
message.id = data.id;
|
||||
}
|
||||
if (data.speedLimit != null) {
|
||||
message.speedLimit = data.speedLimit;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
@ -1951,6 +1965,7 @@ export namespace state {
|
||||
ipSingleSwitchStusBlocked2?: boolean;
|
||||
ipSingleSwitchStusLostIndication?: boolean;
|
||||
id?: string;
|
||||
speedLimit?: number;
|
||||
} = {};
|
||||
if (this.ipSingleSwitchStusCiOccupied != null) {
|
||||
data.ipSingleSwitchStusCiOccupied = this.ipSingleSwitchStusCiOccupied;
|
||||
@ -2036,6 +2051,9 @@ export namespace state {
|
||||
if (this.id != null) {
|
||||
data.id = this.id;
|
||||
}
|
||||
if (this.speedLimit != null) {
|
||||
data.speedLimit = this.speedLimit;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
@ -2098,6 +2116,8 @@ export namespace state {
|
||||
writer.writeBool(27, this.ipSingleSwitchStusLostIndication);
|
||||
if (this.id.length)
|
||||
writer.writeString(28, this.id);
|
||||
if (this.speedLimit != 0)
|
||||
writer.writeInt32(29, this.speedLimit);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
@ -2191,6 +2211,9 @@ export namespace state {
|
||||
case 28:
|
||||
message.id = reader.readString();
|
||||
break;
|
||||
case 29:
|
||||
message.speedLimit = reader.readInt32();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
@ -2218,6 +2241,8 @@ export namespace state {
|
||||
overlap?: boolean;
|
||||
blocked?: boolean;
|
||||
id?: string;
|
||||
speedLimit?: number;
|
||||
limitType?: Track.LimitType;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||
@ -2258,6 +2283,12 @@ export namespace state {
|
||||
if ("id" in data && data.id != undefined) {
|
||||
this.id = data.id;
|
||||
}
|
||||
if ("speedLimit" in data && data.speedLimit != undefined) {
|
||||
this.speedLimit = data.speedLimit;
|
||||
}
|
||||
if ("limitType" in data && data.limitType != undefined) {
|
||||
this.limitType = data.limitType;
|
||||
}
|
||||
}
|
||||
}
|
||||
get ciOccupied() {
|
||||
@ -2332,6 +2363,18 @@ export namespace state {
|
||||
set id(value: string) {
|
||||
pb_1.Message.setField(this, 12, value);
|
||||
}
|
||||
get speedLimit() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 13, 0) as number;
|
||||
}
|
||||
set speedLimit(value: number) {
|
||||
pb_1.Message.setField(this, 13, value);
|
||||
}
|
||||
get limitType() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 14, Track.LimitType.Unknown) as Track.LimitType;
|
||||
}
|
||||
set limitType(value: Track.LimitType) {
|
||||
pb_1.Message.setField(this, 14, value);
|
||||
}
|
||||
static fromObject(data: {
|
||||
ciOccupied?: boolean;
|
||||
cbtcOccupied?: boolean;
|
||||
@ -2345,6 +2388,8 @@ export namespace state {
|
||||
overlap?: boolean;
|
||||
blocked?: boolean;
|
||||
id?: string;
|
||||
speedLimit?: number;
|
||||
limitType?: Track.LimitType;
|
||||
}): Track {
|
||||
const message = new Track({});
|
||||
if (data.ciOccupied != null) {
|
||||
@ -2383,6 +2428,12 @@ export namespace state {
|
||||
if (data.id != null) {
|
||||
message.id = data.id;
|
||||
}
|
||||
if (data.speedLimit != null) {
|
||||
message.speedLimit = data.speedLimit;
|
||||
}
|
||||
if (data.limitType != null) {
|
||||
message.limitType = data.limitType;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
@ -2399,6 +2450,8 @@ export namespace state {
|
||||
overlap?: boolean;
|
||||
blocked?: boolean;
|
||||
id?: string;
|
||||
speedLimit?: number;
|
||||
limitType?: Track.LimitType;
|
||||
} = {};
|
||||
if (this.ciOccupied != null) {
|
||||
data.ciOccupied = this.ciOccupied;
|
||||
@ -2436,6 +2489,12 @@ export namespace state {
|
||||
if (this.id != null) {
|
||||
data.id = this.id;
|
||||
}
|
||||
if (this.speedLimit != null) {
|
||||
data.speedLimit = this.speedLimit;
|
||||
}
|
||||
if (this.limitType != null) {
|
||||
data.limitType = this.limitType;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
@ -2466,6 +2525,10 @@ export namespace state {
|
||||
writer.writeBool(11, this.blocked);
|
||||
if (this.id.length)
|
||||
writer.writeString(12, this.id);
|
||||
if (this.speedLimit != 0)
|
||||
writer.writeInt32(13, this.speedLimit);
|
||||
if (this.limitType != Track.LimitType.Unknown)
|
||||
writer.writeEnum(14, this.limitType);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
@ -2511,6 +2574,12 @@ export namespace state {
|
||||
case 12:
|
||||
message.id = reader.readString();
|
||||
break;
|
||||
case 13:
|
||||
message.speedLimit = reader.readInt32();
|
||||
break;
|
||||
case 14:
|
||||
message.limitType = reader.readEnum();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
@ -2523,6 +2592,14 @@ export namespace state {
|
||||
return Track.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
export namespace Track {
|
||||
export enum LimitType {
|
||||
Unknown = 0,
|
||||
Cbtc = 1,
|
||||
Interlock = 2,
|
||||
CbtcInterlock = 4
|
||||
}
|
||||
}
|
||||
export class Platform extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
@ -2540,6 +2617,9 @@ export namespace state {
|
||||
upTrainSkipstop?: boolean;
|
||||
downTrainSkipstop?: boolean;
|
||||
id?: string;
|
||||
nextSectionRunTime?: number;
|
||||
nextSectionRunLevel?: number;
|
||||
stopTime?: number;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||
@ -2586,6 +2666,15 @@ export namespace state {
|
||||
if ("id" in data && data.id != undefined) {
|
||||
this.id = data.id;
|
||||
}
|
||||
if ("nextSectionRunTime" in data && data.nextSectionRunTime != undefined) {
|
||||
this.nextSectionRunTime = data.nextSectionRunTime;
|
||||
}
|
||||
if ("nextSectionRunLevel" in data && data.nextSectionRunLevel != undefined) {
|
||||
this.nextSectionRunLevel = data.nextSectionRunLevel;
|
||||
}
|
||||
if ("stopTime" in data && data.stopTime != undefined) {
|
||||
this.stopTime = data.stopTime;
|
||||
}
|
||||
}
|
||||
}
|
||||
get emergstop() {
|
||||
@ -2672,6 +2761,24 @@ export namespace state {
|
||||
set id(value: string) {
|
||||
pb_1.Message.setField(this, 14, value);
|
||||
}
|
||||
get nextSectionRunTime() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 15, 0) as number;
|
||||
}
|
||||
set nextSectionRunTime(value: number) {
|
||||
pb_1.Message.setField(this, 15, value);
|
||||
}
|
||||
get nextSectionRunLevel() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 16, 0) as number;
|
||||
}
|
||||
set nextSectionRunLevel(value: number) {
|
||||
pb_1.Message.setField(this, 16, value);
|
||||
}
|
||||
get stopTime() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 17, 0) as number;
|
||||
}
|
||||
set stopTime(value: number) {
|
||||
pb_1.Message.setField(this, 17, value);
|
||||
}
|
||||
static fromObject(data: {
|
||||
emergstop?: boolean;
|
||||
trainberth?: boolean;
|
||||
@ -2687,6 +2794,9 @@ export namespace state {
|
||||
upTrainSkipstop?: boolean;
|
||||
downTrainSkipstop?: boolean;
|
||||
id?: string;
|
||||
nextSectionRunTime?: number;
|
||||
nextSectionRunLevel?: number;
|
||||
stopTime?: number;
|
||||
}): Platform {
|
||||
const message = new Platform({});
|
||||
if (data.emergstop != null) {
|
||||
@ -2731,6 +2841,15 @@ export namespace state {
|
||||
if (data.id != null) {
|
||||
message.id = data.id;
|
||||
}
|
||||
if (data.nextSectionRunTime != null) {
|
||||
message.nextSectionRunTime = data.nextSectionRunTime;
|
||||
}
|
||||
if (data.nextSectionRunLevel != null) {
|
||||
message.nextSectionRunLevel = data.nextSectionRunLevel;
|
||||
}
|
||||
if (data.stopTime != null) {
|
||||
message.stopTime = data.stopTime;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
@ -2749,6 +2868,9 @@ export namespace state {
|
||||
upTrainSkipstop?: boolean;
|
||||
downTrainSkipstop?: boolean;
|
||||
id?: string;
|
||||
nextSectionRunTime?: number;
|
||||
nextSectionRunLevel?: number;
|
||||
stopTime?: number;
|
||||
} = {};
|
||||
if (this.emergstop != null) {
|
||||
data.emergstop = this.emergstop;
|
||||
@ -2792,6 +2914,15 @@ export namespace state {
|
||||
if (this.id != null) {
|
||||
data.id = this.id;
|
||||
}
|
||||
if (this.nextSectionRunTime != null) {
|
||||
data.nextSectionRunTime = this.nextSectionRunTime;
|
||||
}
|
||||
if (this.nextSectionRunLevel != null) {
|
||||
data.nextSectionRunLevel = this.nextSectionRunLevel;
|
||||
}
|
||||
if (this.stopTime != null) {
|
||||
data.stopTime = this.stopTime;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
@ -2826,6 +2957,12 @@ export namespace state {
|
||||
writer.writeBool(13, this.downTrainSkipstop);
|
||||
if (this.id.length)
|
||||
writer.writeString(14, this.id);
|
||||
if (this.nextSectionRunTime != 0)
|
||||
writer.writeInt32(15, this.nextSectionRunTime);
|
||||
if (this.nextSectionRunLevel != 0)
|
||||
writer.writeInt32(16, this.nextSectionRunLevel);
|
||||
if (this.stopTime != 0)
|
||||
writer.writeInt32(17, this.stopTime);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
@ -2877,6 +3014,15 @@ export namespace state {
|
||||
case 14:
|
||||
message.id = reader.readString();
|
||||
break;
|
||||
case 15:
|
||||
message.nextSectionRunTime = reader.readInt32();
|
||||
break;
|
||||
case 16:
|
||||
message.nextSectionRunLevel = reader.readInt32();
|
||||
break;
|
||||
case 17:
|
||||
message.stopTime = reader.readInt32();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
@ -4236,4 +4382,94 @@ export namespace state {
|
||||
return TrainMode.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
export class OccNccFepNetwork extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
id?: string;
|
||||
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 ("id" in data && data.id != undefined) {
|
||||
this.id = data.id;
|
||||
}
|
||||
if ("active" in data && data.active != undefined) {
|
||||
this.active = data.active;
|
||||
}
|
||||
}
|
||||
}
|
||||
get id() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
|
||||
}
|
||||
set id(value: string) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
get active() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 2, false) as boolean;
|
||||
}
|
||||
set active(value: boolean) {
|
||||
pb_1.Message.setField(this, 2, value);
|
||||
}
|
||||
static fromObject(data: {
|
||||
id?: string;
|
||||
active?: boolean;
|
||||
}): OccNccFepNetwork {
|
||||
const message = new OccNccFepNetwork({});
|
||||
if (data.id != null) {
|
||||
message.id = data.id;
|
||||
}
|
||||
if (data.active != null) {
|
||||
message.active = data.active;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {
|
||||
id?: string;
|
||||
active?: boolean;
|
||||
} = {};
|
||||
if (this.id != null) {
|
||||
data.id = this.id;
|
||||
}
|
||||
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.id.length)
|
||||
writer.writeString(1, this.id);
|
||||
if (this.active != false)
|
||||
writer.writeBool(2, this.active);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): OccNccFepNetwork {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new OccNccFepNetwork();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.id = reader.readString();
|
||||
break;
|
||||
case 2:
|
||||
message.active = reader.readBool();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary(): Uint8Array {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes: Uint8Array): OccNccFepNetwork {
|
||||
return OccNccFepNetwork.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -13,13 +13,16 @@ export namespace graphicData {
|
||||
iscsFans?: IscsFan[];
|
||||
Platforms?: Platform[];
|
||||
stations?: Station[];
|
||||
Rects?: Rect[];
|
||||
rects?: Rect[];
|
||||
train?: Train[];
|
||||
signals?: Signal[];
|
||||
turnouts?: Turnout[];
|
||||
section?: Section[];
|
||||
stationLines?: StationLine[];
|
||||
runLines?: RunLine[];
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2, 3, 4, 5, 6, 7, 8, 9], this.#one_of_decls);
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], this.#one_of_decls);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("canvas" in data && data.canvas != undefined) {
|
||||
this.canvas = data.canvas;
|
||||
@ -36,8 +39,8 @@ export namespace graphicData {
|
||||
if ("stations" in data && data.stations != undefined) {
|
||||
this.stations = data.stations;
|
||||
}
|
||||
if ("Rects" in data && data.Rects != undefined) {
|
||||
this.Rects = data.Rects;
|
||||
if ("rects" in data && data.rects != undefined) {
|
||||
this.rects = data.rects;
|
||||
}
|
||||
if ("train" in data && data.train != undefined) {
|
||||
this.train = data.train;
|
||||
@ -48,6 +51,15 @@ export namespace graphicData {
|
||||
if ("turnouts" in data && data.turnouts != undefined) {
|
||||
this.turnouts = data.turnouts;
|
||||
}
|
||||
if ("section" in data && data.section != undefined) {
|
||||
this.section = data.section;
|
||||
}
|
||||
if ("stationLines" in data && data.stationLines != undefined) {
|
||||
this.stationLines = data.stationLines;
|
||||
}
|
||||
if ("runLines" in data && data.runLines != undefined) {
|
||||
this.runLines = data.runLines;
|
||||
}
|
||||
}
|
||||
}
|
||||
get canvas() {
|
||||
@ -83,10 +95,10 @@ export namespace graphicData {
|
||||
set stations(value: Station[]) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 5, value);
|
||||
}
|
||||
get Rects() {
|
||||
get rects() {
|
||||
return pb_1.Message.getRepeatedWrapperField(this, Rect, 6) as Rect[];
|
||||
}
|
||||
set Rects(value: Rect[]) {
|
||||
set rects(value: Rect[]) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 6, value);
|
||||
}
|
||||
get train() {
|
||||
@ -107,16 +119,37 @@ export namespace graphicData {
|
||||
set turnouts(value: Turnout[]) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 9, value);
|
||||
}
|
||||
get section() {
|
||||
return pb_1.Message.getRepeatedWrapperField(this, Section, 10) as Section[];
|
||||
}
|
||||
set section(value: Section[]) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 10, value);
|
||||
}
|
||||
get stationLines() {
|
||||
return pb_1.Message.getRepeatedWrapperField(this, StationLine, 11) as StationLine[];
|
||||
}
|
||||
set stationLines(value: StationLine[]) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 11, value);
|
||||
}
|
||||
get runLines() {
|
||||
return pb_1.Message.getRepeatedWrapperField(this, RunLine, 12) as RunLine[];
|
||||
}
|
||||
set runLines(value: RunLine[]) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 12, value);
|
||||
}
|
||||
static fromObject(data: {
|
||||
canvas?: ReturnType<typeof Canvas.prototype.toObject>;
|
||||
links?: ReturnType<typeof Link.prototype.toObject>[];
|
||||
iscsFans?: ReturnType<typeof IscsFan.prototype.toObject>[];
|
||||
Platforms?: ReturnType<typeof Platform.prototype.toObject>[];
|
||||
stations?: ReturnType<typeof Station.prototype.toObject>[];
|
||||
Rects?: ReturnType<typeof Rect.prototype.toObject>[];
|
||||
rects?: ReturnType<typeof Rect.prototype.toObject>[];
|
||||
train?: ReturnType<typeof Train.prototype.toObject>[];
|
||||
signals?: ReturnType<typeof Signal.prototype.toObject>[];
|
||||
turnouts?: ReturnType<typeof Turnout.prototype.toObject>[];
|
||||
section?: ReturnType<typeof Section.prototype.toObject>[];
|
||||
stationLines?: ReturnType<typeof StationLine.prototype.toObject>[];
|
||||
runLines?: ReturnType<typeof RunLine.prototype.toObject>[];
|
||||
}): RtssGraphicStorage {
|
||||
const message = new RtssGraphicStorage({});
|
||||
if (data.canvas != null) {
|
||||
@ -134,8 +167,8 @@ export namespace graphicData {
|
||||
if (data.stations != null) {
|
||||
message.stations = data.stations.map(item => Station.fromObject(item));
|
||||
}
|
||||
if (data.Rects != null) {
|
||||
message.Rects = data.Rects.map(item => Rect.fromObject(item));
|
||||
if (data.rects != null) {
|
||||
message.rects = data.rects.map(item => Rect.fromObject(item));
|
||||
}
|
||||
if (data.train != null) {
|
||||
message.train = data.train.map(item => Train.fromObject(item));
|
||||
@ -146,6 +179,15 @@ export namespace graphicData {
|
||||
if (data.turnouts != null) {
|
||||
message.turnouts = data.turnouts.map(item => Turnout.fromObject(item));
|
||||
}
|
||||
if (data.section != null) {
|
||||
message.section = data.section.map(item => Section.fromObject(item));
|
||||
}
|
||||
if (data.stationLines != null) {
|
||||
message.stationLines = data.stationLines.map(item => StationLine.fromObject(item));
|
||||
}
|
||||
if (data.runLines != null) {
|
||||
message.runLines = data.runLines.map(item => RunLine.fromObject(item));
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
@ -155,10 +197,13 @@ export namespace graphicData {
|
||||
iscsFans?: ReturnType<typeof IscsFan.prototype.toObject>[];
|
||||
Platforms?: ReturnType<typeof Platform.prototype.toObject>[];
|
||||
stations?: ReturnType<typeof Station.prototype.toObject>[];
|
||||
Rects?: ReturnType<typeof Rect.prototype.toObject>[];
|
||||
rects?: ReturnType<typeof Rect.prototype.toObject>[];
|
||||
train?: ReturnType<typeof Train.prototype.toObject>[];
|
||||
signals?: ReturnType<typeof Signal.prototype.toObject>[];
|
||||
turnouts?: ReturnType<typeof Turnout.prototype.toObject>[];
|
||||
section?: ReturnType<typeof Section.prototype.toObject>[];
|
||||
stationLines?: ReturnType<typeof StationLine.prototype.toObject>[];
|
||||
runLines?: ReturnType<typeof RunLine.prototype.toObject>[];
|
||||
} = {};
|
||||
if (this.canvas != null) {
|
||||
data.canvas = this.canvas.toObject();
|
||||
@ -175,8 +220,8 @@ export namespace graphicData {
|
||||
if (this.stations != null) {
|
||||
data.stations = this.stations.map((item: Station) => item.toObject());
|
||||
}
|
||||
if (this.Rects != null) {
|
||||
data.Rects = this.Rects.map((item: Rect) => item.toObject());
|
||||
if (this.rects != null) {
|
||||
data.rects = this.rects.map((item: Rect) => item.toObject());
|
||||
}
|
||||
if (this.train != null) {
|
||||
data.train = this.train.map((item: Train) => item.toObject());
|
||||
@ -187,6 +232,15 @@ export namespace graphicData {
|
||||
if (this.turnouts != null) {
|
||||
data.turnouts = this.turnouts.map((item: Turnout) => item.toObject());
|
||||
}
|
||||
if (this.section != null) {
|
||||
data.section = this.section.map((item: Section) => item.toObject());
|
||||
}
|
||||
if (this.stationLines != null) {
|
||||
data.stationLines = this.stationLines.map((item: StationLine) => item.toObject());
|
||||
}
|
||||
if (this.runLines != null) {
|
||||
data.runLines = this.runLines.map((item: RunLine) => item.toObject());
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
@ -203,14 +257,20 @@ export namespace graphicData {
|
||||
writer.writeRepeatedMessage(4, this.Platforms, (item: Platform) => item.serialize(writer));
|
||||
if (this.stations.length)
|
||||
writer.writeRepeatedMessage(5, this.stations, (item: Station) => item.serialize(writer));
|
||||
if (this.Rects.length)
|
||||
writer.writeRepeatedMessage(6, this.Rects, (item: Rect) => item.serialize(writer));
|
||||
if (this.rects.length)
|
||||
writer.writeRepeatedMessage(6, this.rects, (item: Rect) => item.serialize(writer));
|
||||
if (this.train.length)
|
||||
writer.writeRepeatedMessage(7, this.train, (item: Train) => item.serialize(writer));
|
||||
if (this.signals.length)
|
||||
writer.writeRepeatedMessage(8, this.signals, (item: Signal) => item.serialize(writer));
|
||||
if (this.turnouts.length)
|
||||
writer.writeRepeatedMessage(9, this.turnouts, (item: Turnout) => item.serialize(writer));
|
||||
if (this.section.length)
|
||||
writer.writeRepeatedMessage(10, this.section, (item: Section) => item.serialize(writer));
|
||||
if (this.stationLines.length)
|
||||
writer.writeRepeatedMessage(11, this.stationLines, (item: StationLine) => item.serialize(writer));
|
||||
if (this.runLines.length)
|
||||
writer.writeRepeatedMessage(12, this.runLines, (item: RunLine) => item.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
@ -236,7 +296,7 @@ export namespace graphicData {
|
||||
reader.readMessage(message.stations, () => pb_1.Message.addToRepeatedWrapperField(message, 5, Station.deserialize(reader), Station));
|
||||
break;
|
||||
case 6:
|
||||
reader.readMessage(message.Rects, () => pb_1.Message.addToRepeatedWrapperField(message, 6, Rect.deserialize(reader), Rect));
|
||||
reader.readMessage(message.rects, () => pb_1.Message.addToRepeatedWrapperField(message, 6, Rect.deserialize(reader), Rect));
|
||||
break;
|
||||
case 7:
|
||||
reader.readMessage(message.train, () => pb_1.Message.addToRepeatedWrapperField(message, 7, Train.deserialize(reader), Train));
|
||||
@ -247,6 +307,15 @@ export namespace graphicData {
|
||||
case 9:
|
||||
reader.readMessage(message.turnouts, () => pb_1.Message.addToRepeatedWrapperField(message, 9, Turnout.deserialize(reader), Turnout));
|
||||
break;
|
||||
case 10:
|
||||
reader.readMessage(message.section, () => pb_1.Message.addToRepeatedWrapperField(message, 10, Section.deserialize(reader), Section));
|
||||
break;
|
||||
case 11:
|
||||
reader.readMessage(message.stationLines, () => pb_1.Message.addToRepeatedWrapperField(message, 11, StationLine.deserialize(reader), StationLine));
|
||||
break;
|
||||
case 12:
|
||||
reader.readMessage(message.runLines, () => pb_1.Message.addToRepeatedWrapperField(message, 12, RunLine.deserialize(reader), RunLine));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
@ -1080,13 +1149,13 @@ export namespace graphicData {
|
||||
code?: string;
|
||||
lineWidth?: number;
|
||||
lineColor?: string;
|
||||
point?: Point;
|
||||
width?: number;
|
||||
height?: number;
|
||||
points?: Point[];
|
||||
radius?: number;
|
||||
point?: Point;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [8], this.#one_of_decls);
|
||||
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;
|
||||
@ -1100,17 +1169,17 @@ export namespace graphicData {
|
||||
if ("lineColor" in data && data.lineColor != undefined) {
|
||||
this.lineColor = data.lineColor;
|
||||
}
|
||||
if ("point" in data && data.point != undefined) {
|
||||
this.point = data.point;
|
||||
}
|
||||
if ("width" in data && data.width != undefined) {
|
||||
this.width = data.width;
|
||||
}
|
||||
if ("height" in data && data.height != undefined) {
|
||||
this.height = data.height;
|
||||
}
|
||||
if ("points" in data && data.points != undefined) {
|
||||
this.points = data.points;
|
||||
if ("radius" in data && data.radius != undefined) {
|
||||
this.radius = data.radius;
|
||||
}
|
||||
if ("point" in data && data.point != undefined) {
|
||||
this.point = data.point;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1141,42 +1210,42 @@ export namespace graphicData {
|
||||
set lineColor(value: string) {
|
||||
pb_1.Message.setField(this, 4, value);
|
||||
}
|
||||
get point() {
|
||||
return pb_1.Message.getWrapperField(this, Point, 5) as Point;
|
||||
}
|
||||
set point(value: Point) {
|
||||
pb_1.Message.setWrapperField(this, 5, value);
|
||||
}
|
||||
get has_point() {
|
||||
return pb_1.Message.getField(this, 5) != null;
|
||||
}
|
||||
get width() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 6, 0) as number;
|
||||
return pb_1.Message.getFieldWithDefault(this, 5, 0) as number;
|
||||
}
|
||||
set width(value: number) {
|
||||
pb_1.Message.setField(this, 6, value);
|
||||
pb_1.Message.setField(this, 5, value);
|
||||
}
|
||||
get height() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 7, 0) as number;
|
||||
return pb_1.Message.getFieldWithDefault(this, 6, 0) as number;
|
||||
}
|
||||
set height(value: number) {
|
||||
pb_1.Message.setField(this, 6, value);
|
||||
}
|
||||
get radius() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 7, 0) as number;
|
||||
}
|
||||
set radius(value: number) {
|
||||
pb_1.Message.setField(this, 7, value);
|
||||
}
|
||||
get points() {
|
||||
return pb_1.Message.getRepeatedWrapperField(this, Point, 8) as Point[];
|
||||
get point() {
|
||||
return pb_1.Message.getWrapperField(this, Point, 8) as Point;
|
||||
}
|
||||
set points(value: Point[]) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 8, value);
|
||||
set point(value: Point) {
|
||||
pb_1.Message.setWrapperField(this, 8, value);
|
||||
}
|
||||
get has_point() {
|
||||
return pb_1.Message.getField(this, 8) != null;
|
||||
}
|
||||
static fromObject(data: {
|
||||
common?: ReturnType<typeof CommonInfo.prototype.toObject>;
|
||||
code?: string;
|
||||
lineWidth?: number;
|
||||
lineColor?: string;
|
||||
point?: ReturnType<typeof Point.prototype.toObject>;
|
||||
width?: number;
|
||||
height?: number;
|
||||
points?: ReturnType<typeof Point.prototype.toObject>[];
|
||||
radius?: number;
|
||||
point?: ReturnType<typeof Point.prototype.toObject>;
|
||||
}): Rect {
|
||||
const message = new Rect({});
|
||||
if (data.common != null) {
|
||||
@ -1191,17 +1260,17 @@ export namespace graphicData {
|
||||
if (data.lineColor != null) {
|
||||
message.lineColor = data.lineColor;
|
||||
}
|
||||
if (data.point != null) {
|
||||
message.point = Point.fromObject(data.point);
|
||||
}
|
||||
if (data.width != null) {
|
||||
message.width = data.width;
|
||||
}
|
||||
if (data.height != null) {
|
||||
message.height = data.height;
|
||||
}
|
||||
if (data.points != null) {
|
||||
message.points = data.points.map(item => Point.fromObject(item));
|
||||
if (data.radius != null) {
|
||||
message.radius = data.radius;
|
||||
}
|
||||
if (data.point != null) {
|
||||
message.point = Point.fromObject(data.point);
|
||||
}
|
||||
return message;
|
||||
}
|
||||
@ -1211,10 +1280,10 @@ export namespace graphicData {
|
||||
code?: string;
|
||||
lineWidth?: number;
|
||||
lineColor?: string;
|
||||
point?: ReturnType<typeof Point.prototype.toObject>;
|
||||
width?: number;
|
||||
height?: number;
|
||||
points?: ReturnType<typeof Point.prototype.toObject>[];
|
||||
radius?: number;
|
||||
point?: ReturnType<typeof Point.prototype.toObject>;
|
||||
} = {};
|
||||
if (this.common != null) {
|
||||
data.common = this.common.toObject();
|
||||
@ -1228,17 +1297,17 @@ export namespace graphicData {
|
||||
if (this.lineColor != null) {
|
||||
data.lineColor = this.lineColor;
|
||||
}
|
||||
if (this.point != null) {
|
||||
data.point = this.point.toObject();
|
||||
}
|
||||
if (this.width != null) {
|
||||
data.width = this.width;
|
||||
}
|
||||
if (this.height != null) {
|
||||
data.height = this.height;
|
||||
}
|
||||
if (this.points != null) {
|
||||
data.points = this.points.map((item: Point) => item.toObject());
|
||||
if (this.radius != null) {
|
||||
data.radius = this.radius;
|
||||
}
|
||||
if (this.point != null) {
|
||||
data.point = this.point.toObject();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
@ -1254,14 +1323,14 @@ export namespace graphicData {
|
||||
writer.writeInt32(3, this.lineWidth);
|
||||
if (this.lineColor.length)
|
||||
writer.writeString(4, this.lineColor);
|
||||
if (this.has_point)
|
||||
writer.writeMessage(5, this.point, () => this.point.serialize(writer));
|
||||
if (this.width != 0)
|
||||
writer.writeFloat(6, this.width);
|
||||
writer.writeFloat(5, this.width);
|
||||
if (this.height != 0)
|
||||
writer.writeFloat(7, this.height);
|
||||
if (this.points.length)
|
||||
writer.writeRepeatedMessage(8, this.points, (item: Point) => item.serialize(writer));
|
||||
writer.writeFloat(6, this.height);
|
||||
if (this.radius != 0)
|
||||
writer.writeInt32(7, this.radius);
|
||||
if (this.has_point)
|
||||
writer.writeMessage(8, this.point, () => this.point.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
@ -1284,16 +1353,16 @@ export namespace graphicData {
|
||||
message.lineColor = reader.readString();
|
||||
break;
|
||||
case 5:
|
||||
reader.readMessage(message.point, () => message.point = Point.deserialize(reader));
|
||||
break;
|
||||
case 6:
|
||||
message.width = reader.readFloat();
|
||||
break;
|
||||
case 7:
|
||||
case 6:
|
||||
message.height = reader.readFloat();
|
||||
break;
|
||||
case 7:
|
||||
message.radius = reader.readInt32();
|
||||
break;
|
||||
case 8:
|
||||
reader.readMessage(message.points, () => pb_1.Message.addToRepeatedWrapperField(message, 8, Point.deserialize(reader), Point));
|
||||
reader.readMessage(message.point, () => message.point = Point.deserialize(reader));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
@ -1539,6 +1608,122 @@ export namespace graphicData {
|
||||
return Station.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
export class StationLine extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
common?: CommonInfo;
|
||||
code?: string;
|
||||
hasTransfer?: 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 ("hasTransfer" in data && data.hasTransfer != undefined) {
|
||||
this.hasTransfer = data.hasTransfer;
|
||||
}
|
||||
}
|
||||
}
|
||||
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 hasTransfer() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 3, false) as boolean;
|
||||
}
|
||||
set hasTransfer(value: boolean) {
|
||||
pb_1.Message.setField(this, 3, value);
|
||||
}
|
||||
static fromObject(data: {
|
||||
common?: ReturnType<typeof CommonInfo.prototype.toObject>;
|
||||
code?: string;
|
||||
hasTransfer?: boolean;
|
||||
}): StationLine {
|
||||
const message = new StationLine({});
|
||||
if (data.common != null) {
|
||||
message.common = CommonInfo.fromObject(data.common);
|
||||
}
|
||||
if (data.code != null) {
|
||||
message.code = data.code;
|
||||
}
|
||||
if (data.hasTransfer != null) {
|
||||
message.hasTransfer = data.hasTransfer;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {
|
||||
common?: ReturnType<typeof CommonInfo.prototype.toObject>;
|
||||
code?: string;
|
||||
hasTransfer?: boolean;
|
||||
} = {};
|
||||
if (this.common != null) {
|
||||
data.common = this.common.toObject();
|
||||
}
|
||||
if (this.code != null) {
|
||||
data.code = this.code;
|
||||
}
|
||||
if (this.hasTransfer != null) {
|
||||
data.hasTransfer = this.hasTransfer;
|
||||
}
|
||||
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.hasTransfer != false)
|
||||
writer.writeBool(3, this.hasTransfer);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): StationLine {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new StationLine();
|
||||
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.hasTransfer = reader.readBool();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary(): Uint8Array {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes: Uint8Array): StationLine {
|
||||
return StationLine.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
export class Train extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
@ -2061,4 +2246,282 @@ export namespace graphicData {
|
||||
return Signal.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
export class RunLine extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
common?: CommonInfo;
|
||||
code?: string;
|
||||
points?: Point[];
|
||||
nameColor?: string;
|
||||
nameBgColor?: string;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3], 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 ("points" in data && data.points != undefined) {
|
||||
this.points = data.points;
|
||||
}
|
||||
if ("nameColor" in data && data.nameColor != undefined) {
|
||||
this.nameColor = data.nameColor;
|
||||
}
|
||||
if ("nameBgColor" in data && data.nameBgColor != undefined) {
|
||||
this.nameBgColor = data.nameBgColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
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 points() {
|
||||
return pb_1.Message.getRepeatedWrapperField(this, Point, 3) as Point[];
|
||||
}
|
||||
set points(value: Point[]) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 3, value);
|
||||
}
|
||||
get nameColor() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 4, "") as string;
|
||||
}
|
||||
set nameColor(value: string) {
|
||||
pb_1.Message.setField(this, 4, value);
|
||||
}
|
||||
get nameBgColor() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 5, "") as string;
|
||||
}
|
||||
set nameBgColor(value: string) {
|
||||
pb_1.Message.setField(this, 5, value);
|
||||
}
|
||||
static fromObject(data: {
|
||||
common?: ReturnType<typeof CommonInfo.prototype.toObject>;
|
||||
code?: string;
|
||||
points?: ReturnType<typeof Point.prototype.toObject>[];
|
||||
nameColor?: string;
|
||||
nameBgColor?: string;
|
||||
}): RunLine {
|
||||
const message = new RunLine({});
|
||||
if (data.common != null) {
|
||||
message.common = CommonInfo.fromObject(data.common);
|
||||
}
|
||||
if (data.code != null) {
|
||||
message.code = data.code;
|
||||
}
|
||||
if (data.points != null) {
|
||||
message.points = data.points.map(item => Point.fromObject(item));
|
||||
}
|
||||
if (data.nameColor != null) {
|
||||
message.nameColor = data.nameColor;
|
||||
}
|
||||
if (data.nameBgColor != null) {
|
||||
message.nameBgColor = data.nameBgColor;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {
|
||||
common?: ReturnType<typeof CommonInfo.prototype.toObject>;
|
||||
code?: string;
|
||||
points?: ReturnType<typeof Point.prototype.toObject>[];
|
||||
nameColor?: string;
|
||||
nameBgColor?: string;
|
||||
} = {};
|
||||
if (this.common != null) {
|
||||
data.common = this.common.toObject();
|
||||
}
|
||||
if (this.code != null) {
|
||||
data.code = this.code;
|
||||
}
|
||||
if (this.points != null) {
|
||||
data.points = this.points.map((item: Point) => item.toObject());
|
||||
}
|
||||
if (this.nameColor != null) {
|
||||
data.nameColor = this.nameColor;
|
||||
}
|
||||
if (this.nameBgColor != null) {
|
||||
data.nameBgColor = this.nameBgColor;
|
||||
}
|
||||
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.points.length)
|
||||
writer.writeRepeatedMessage(3, this.points, (item: Point) => item.serialize(writer));
|
||||
if (this.nameColor.length)
|
||||
writer.writeString(4, this.nameColor);
|
||||
if (this.nameBgColor.length)
|
||||
writer.writeString(5, this.nameBgColor);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): RunLine {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new RunLine();
|
||||
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:
|
||||
reader.readMessage(message.points, () => pb_1.Message.addToRepeatedWrapperField(message, 3, Point.deserialize(reader), Point));
|
||||
break;
|
||||
case 4:
|
||||
message.nameColor = reader.readString();
|
||||
break;
|
||||
case 5:
|
||||
message.nameBgColor = reader.readString();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary(): Uint8Array {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes: Uint8Array): RunLine {
|
||||
return RunLine.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
export class Section extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
common?: CommonInfo;
|
||||
code?: string;
|
||||
points?: Point[];
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3], 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 ("points" in data && data.points != undefined) {
|
||||
this.points = data.points;
|
||||
}
|
||||
}
|
||||
}
|
||||
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 points() {
|
||||
return pb_1.Message.getRepeatedWrapperField(this, Point, 3) as Point[];
|
||||
}
|
||||
set points(value: Point[]) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 3, value);
|
||||
}
|
||||
static fromObject(data: {
|
||||
common?: ReturnType<typeof CommonInfo.prototype.toObject>;
|
||||
code?: string;
|
||||
points?: ReturnType<typeof Point.prototype.toObject>[];
|
||||
}): Section {
|
||||
const message = new Section({});
|
||||
if (data.common != null) {
|
||||
message.common = CommonInfo.fromObject(data.common);
|
||||
}
|
||||
if (data.code != null) {
|
||||
message.code = data.code;
|
||||
}
|
||||
if (data.points != null) {
|
||||
message.points = data.points.map(item => Point.fromObject(item));
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {
|
||||
common?: ReturnType<typeof CommonInfo.prototype.toObject>;
|
||||
code?: string;
|
||||
points?: ReturnType<typeof Point.prototype.toObject>[];
|
||||
} = {};
|
||||
if (this.common != null) {
|
||||
data.common = this.common.toObject();
|
||||
}
|
||||
if (this.code != null) {
|
||||
data.code = this.code;
|
||||
}
|
||||
if (this.points != null) {
|
||||
data.points = this.points.map((item: Point) => item.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_common)
|
||||
writer.writeMessage(1, this.common, () => this.common.serialize(writer));
|
||||
if (this.code.length)
|
||||
writer.writeString(2, this.code);
|
||||
if (this.points.length)
|
||||
writer.writeRepeatedMessage(3, this.points, (item: Point) => item.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Section {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Section();
|
||||
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:
|
||||
reader.readMessage(message.points, () => pb_1.Message.addToRepeatedWrapperField(message, 3, Point.deserialize(reader), Point));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary(): Uint8Array {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes: Uint8Array): Section {
|
||||
return Section.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
488
src/protos/trans.ts
Normal file
488
src/protos/trans.ts
Normal file
@ -0,0 +1,488 @@
|
||||
/**
|
||||
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||
* compiler version: 4.23.1
|
||||
* source: trans.proto
|
||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||
import * as dependency_1 from "./device_status";
|
||||
import * as pb_1 from "google-protobuf";
|
||||
export namespace trans {
|
||||
export class RtuDevicesStorage extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
lineId?: number;
|
||||
rtuId?: number;
|
||||
all?: boolean;
|
||||
signal?: dependency_1.state.Signal[];
|
||||
switch?: dependency_1.state.Switch[];
|
||||
platform?: dependency_1.state.Platform[];
|
||||
track?: dependency_1.state.Track[];
|
||||
rtu?: dependency_1.state.Rtu[];
|
||||
station?: dependency_1.state.Station[];
|
||||
entry?: dependency_1.state.Entry[];
|
||||
scada?: dependency_1.state.Scada[];
|
||||
waterProofDoor?: dependency_1.state.WaterProofDoor[];
|
||||
workArea?: dependency_1.state.WorkArea[];
|
||||
gama?: dependency_1.state.Gama[];
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], this.#one_of_decls);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("lineId" in data && data.lineId != undefined) {
|
||||
this.lineId = data.lineId;
|
||||
}
|
||||
if ("rtuId" in data && data.rtuId != undefined) {
|
||||
this.rtuId = data.rtuId;
|
||||
}
|
||||
if ("all" in data && data.all != undefined) {
|
||||
this.all = data.all;
|
||||
}
|
||||
if ("signal" in data && data.signal != undefined) {
|
||||
this.signal = data.signal;
|
||||
}
|
||||
if ("switch" in data && data.switch != undefined) {
|
||||
this.switch = data.switch;
|
||||
}
|
||||
if ("platform" in data && data.platform != undefined) {
|
||||
this.platform = data.platform;
|
||||
}
|
||||
if ("track" in data && data.track != undefined) {
|
||||
this.track = data.track;
|
||||
}
|
||||
if ("rtu" in data && data.rtu != undefined) {
|
||||
this.rtu = data.rtu;
|
||||
}
|
||||
if ("station" in data && data.station != undefined) {
|
||||
this.station = data.station;
|
||||
}
|
||||
if ("entry" in data && data.entry != undefined) {
|
||||
this.entry = data.entry;
|
||||
}
|
||||
if ("scada" in data && data.scada != undefined) {
|
||||
this.scada = data.scada;
|
||||
}
|
||||
if ("waterProofDoor" in data && data.waterProofDoor != undefined) {
|
||||
this.waterProofDoor = data.waterProofDoor;
|
||||
}
|
||||
if ("workArea" in data && data.workArea != undefined) {
|
||||
this.workArea = data.workArea;
|
||||
}
|
||||
if ("gama" in data && data.gama != undefined) {
|
||||
this.gama = data.gama;
|
||||
}
|
||||
}
|
||||
}
|
||||
get lineId() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 1, 0) as number;
|
||||
}
|
||||
set lineId(value: number) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
get rtuId() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 2, 0) as number;
|
||||
}
|
||||
set rtuId(value: number) {
|
||||
pb_1.Message.setField(this, 2, value);
|
||||
}
|
||||
get all() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 3, false) as boolean;
|
||||
}
|
||||
set all(value: boolean) {
|
||||
pb_1.Message.setField(this, 3, value);
|
||||
}
|
||||
get signal() {
|
||||
return pb_1.Message.getRepeatedWrapperField(this, dependency_1.state.Signal, 4) as dependency_1.state.Signal[];
|
||||
}
|
||||
set signal(value: dependency_1.state.Signal[]) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 4, value);
|
||||
}
|
||||
get switch() {
|
||||
return pb_1.Message.getRepeatedWrapperField(this, dependency_1.state.Switch, 5) as dependency_1.state.Switch[];
|
||||
}
|
||||
set switch(value: dependency_1.state.Switch[]) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 5, value);
|
||||
}
|
||||
get platform() {
|
||||
return pb_1.Message.getRepeatedWrapperField(this, dependency_1.state.Platform, 6) as dependency_1.state.Platform[];
|
||||
}
|
||||
set platform(value: dependency_1.state.Platform[]) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 6, value);
|
||||
}
|
||||
get track() {
|
||||
return pb_1.Message.getRepeatedWrapperField(this, dependency_1.state.Track, 7) as dependency_1.state.Track[];
|
||||
}
|
||||
set track(value: dependency_1.state.Track[]) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 7, value);
|
||||
}
|
||||
get rtu() {
|
||||
return pb_1.Message.getRepeatedWrapperField(this, dependency_1.state.Rtu, 8) as dependency_1.state.Rtu[];
|
||||
}
|
||||
set rtu(value: dependency_1.state.Rtu[]) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 8, value);
|
||||
}
|
||||
get station() {
|
||||
return pb_1.Message.getRepeatedWrapperField(this, dependency_1.state.Station, 9) as dependency_1.state.Station[];
|
||||
}
|
||||
set station(value: dependency_1.state.Station[]) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 9, value);
|
||||
}
|
||||
get entry() {
|
||||
return pb_1.Message.getRepeatedWrapperField(this, dependency_1.state.Entry, 10) as dependency_1.state.Entry[];
|
||||
}
|
||||
set entry(value: dependency_1.state.Entry[]) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 10, value);
|
||||
}
|
||||
get scada() {
|
||||
return pb_1.Message.getRepeatedWrapperField(this, dependency_1.state.Scada, 11) as dependency_1.state.Scada[];
|
||||
}
|
||||
set scada(value: dependency_1.state.Scada[]) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 11, value);
|
||||
}
|
||||
get waterProofDoor() {
|
||||
return pb_1.Message.getRepeatedWrapperField(this, dependency_1.state.WaterProofDoor, 12) as dependency_1.state.WaterProofDoor[];
|
||||
}
|
||||
set waterProofDoor(value: dependency_1.state.WaterProofDoor[]) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 12, value);
|
||||
}
|
||||
get workArea() {
|
||||
return pb_1.Message.getRepeatedWrapperField(this, dependency_1.state.WorkArea, 13) as dependency_1.state.WorkArea[];
|
||||
}
|
||||
set workArea(value: dependency_1.state.WorkArea[]) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 13, value);
|
||||
}
|
||||
get gama() {
|
||||
return pb_1.Message.getRepeatedWrapperField(this, dependency_1.state.Gama, 14) as dependency_1.state.Gama[];
|
||||
}
|
||||
set gama(value: dependency_1.state.Gama[]) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 14, value);
|
||||
}
|
||||
static fromObject(data: {
|
||||
lineId?: number;
|
||||
rtuId?: number;
|
||||
all?: boolean;
|
||||
signal?: ReturnType<typeof dependency_1.state.Signal.prototype.toObject>[];
|
||||
switch?: ReturnType<typeof dependency_1.state.Switch.prototype.toObject>[];
|
||||
platform?: ReturnType<typeof dependency_1.state.Platform.prototype.toObject>[];
|
||||
track?: ReturnType<typeof dependency_1.state.Track.prototype.toObject>[];
|
||||
rtu?: ReturnType<typeof dependency_1.state.Rtu.prototype.toObject>[];
|
||||
station?: ReturnType<typeof dependency_1.state.Station.prototype.toObject>[];
|
||||
entry?: ReturnType<typeof dependency_1.state.Entry.prototype.toObject>[];
|
||||
scada?: ReturnType<typeof dependency_1.state.Scada.prototype.toObject>[];
|
||||
waterProofDoor?: ReturnType<typeof dependency_1.state.WaterProofDoor.prototype.toObject>[];
|
||||
workArea?: ReturnType<typeof dependency_1.state.WorkArea.prototype.toObject>[];
|
||||
gama?: ReturnType<typeof dependency_1.state.Gama.prototype.toObject>[];
|
||||
}): RtuDevicesStorage {
|
||||
const message = new RtuDevicesStorage({});
|
||||
if (data.lineId != null) {
|
||||
message.lineId = data.lineId;
|
||||
}
|
||||
if (data.rtuId != null) {
|
||||
message.rtuId = data.rtuId;
|
||||
}
|
||||
if (data.all != null) {
|
||||
message.all = data.all;
|
||||
}
|
||||
if (data.signal != null) {
|
||||
message.signal = data.signal.map(item => dependency_1.state.Signal.fromObject(item));
|
||||
}
|
||||
if (data.switch != null) {
|
||||
message.switch = data.switch.map(item => dependency_1.state.Switch.fromObject(item));
|
||||
}
|
||||
if (data.platform != null) {
|
||||
message.platform = data.platform.map(item => dependency_1.state.Platform.fromObject(item));
|
||||
}
|
||||
if (data.track != null) {
|
||||
message.track = data.track.map(item => dependency_1.state.Track.fromObject(item));
|
||||
}
|
||||
if (data.rtu != null) {
|
||||
message.rtu = data.rtu.map(item => dependency_1.state.Rtu.fromObject(item));
|
||||
}
|
||||
if (data.station != null) {
|
||||
message.station = data.station.map(item => dependency_1.state.Station.fromObject(item));
|
||||
}
|
||||
if (data.entry != null) {
|
||||
message.entry = data.entry.map(item => dependency_1.state.Entry.fromObject(item));
|
||||
}
|
||||
if (data.scada != null) {
|
||||
message.scada = data.scada.map(item => dependency_1.state.Scada.fromObject(item));
|
||||
}
|
||||
if (data.waterProofDoor != null) {
|
||||
message.waterProofDoor = data.waterProofDoor.map(item => dependency_1.state.WaterProofDoor.fromObject(item));
|
||||
}
|
||||
if (data.workArea != null) {
|
||||
message.workArea = data.workArea.map(item => dependency_1.state.WorkArea.fromObject(item));
|
||||
}
|
||||
if (data.gama != null) {
|
||||
message.gama = data.gama.map(item => dependency_1.state.Gama.fromObject(item));
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {
|
||||
lineId?: number;
|
||||
rtuId?: number;
|
||||
all?: boolean;
|
||||
signal?: ReturnType<typeof dependency_1.state.Signal.prototype.toObject>[];
|
||||
switch?: ReturnType<typeof dependency_1.state.Switch.prototype.toObject>[];
|
||||
platform?: ReturnType<typeof dependency_1.state.Platform.prototype.toObject>[];
|
||||
track?: ReturnType<typeof dependency_1.state.Track.prototype.toObject>[];
|
||||
rtu?: ReturnType<typeof dependency_1.state.Rtu.prototype.toObject>[];
|
||||
station?: ReturnType<typeof dependency_1.state.Station.prototype.toObject>[];
|
||||
entry?: ReturnType<typeof dependency_1.state.Entry.prototype.toObject>[];
|
||||
scada?: ReturnType<typeof dependency_1.state.Scada.prototype.toObject>[];
|
||||
waterProofDoor?: ReturnType<typeof dependency_1.state.WaterProofDoor.prototype.toObject>[];
|
||||
workArea?: ReturnType<typeof dependency_1.state.WorkArea.prototype.toObject>[];
|
||||
gama?: ReturnType<typeof dependency_1.state.Gama.prototype.toObject>[];
|
||||
} = {};
|
||||
if (this.lineId != null) {
|
||||
data.lineId = this.lineId;
|
||||
}
|
||||
if (this.rtuId != null) {
|
||||
data.rtuId = this.rtuId;
|
||||
}
|
||||
if (this.all != null) {
|
||||
data.all = this.all;
|
||||
}
|
||||
if (this.signal != null) {
|
||||
data.signal = this.signal.map((item: dependency_1.state.Signal) => item.toObject());
|
||||
}
|
||||
if (this.switch != null) {
|
||||
data.switch = this.switch.map((item: dependency_1.state.Switch) => item.toObject());
|
||||
}
|
||||
if (this.platform != null) {
|
||||
data.platform = this.platform.map((item: dependency_1.state.Platform) => item.toObject());
|
||||
}
|
||||
if (this.track != null) {
|
||||
data.track = this.track.map((item: dependency_1.state.Track) => item.toObject());
|
||||
}
|
||||
if (this.rtu != null) {
|
||||
data.rtu = this.rtu.map((item: dependency_1.state.Rtu) => item.toObject());
|
||||
}
|
||||
if (this.station != null) {
|
||||
data.station = this.station.map((item: dependency_1.state.Station) => item.toObject());
|
||||
}
|
||||
if (this.entry != null) {
|
||||
data.entry = this.entry.map((item: dependency_1.state.Entry) => item.toObject());
|
||||
}
|
||||
if (this.scada != null) {
|
||||
data.scada = this.scada.map((item: dependency_1.state.Scada) => item.toObject());
|
||||
}
|
||||
if (this.waterProofDoor != null) {
|
||||
data.waterProofDoor = this.waterProofDoor.map((item: dependency_1.state.WaterProofDoor) => item.toObject());
|
||||
}
|
||||
if (this.workArea != null) {
|
||||
data.workArea = this.workArea.map((item: dependency_1.state.WorkArea) => item.toObject());
|
||||
}
|
||||
if (this.gama != null) {
|
||||
data.gama = this.gama.map((item: dependency_1.state.Gama) => item.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.lineId != 0)
|
||||
writer.writeInt32(1, this.lineId);
|
||||
if (this.rtuId != 0)
|
||||
writer.writeInt32(2, this.rtuId);
|
||||
if (this.all != false)
|
||||
writer.writeBool(3, this.all);
|
||||
if (this.signal.length)
|
||||
writer.writeRepeatedMessage(4, this.signal, (item: dependency_1.state.Signal) => item.serialize(writer));
|
||||
if (this.switch.length)
|
||||
writer.writeRepeatedMessage(5, this.switch, (item: dependency_1.state.Switch) => item.serialize(writer));
|
||||
if (this.platform.length)
|
||||
writer.writeRepeatedMessage(6, this.platform, (item: dependency_1.state.Platform) => item.serialize(writer));
|
||||
if (this.track.length)
|
||||
writer.writeRepeatedMessage(7, this.track, (item: dependency_1.state.Track) => item.serialize(writer));
|
||||
if (this.rtu.length)
|
||||
writer.writeRepeatedMessage(8, this.rtu, (item: dependency_1.state.Rtu) => item.serialize(writer));
|
||||
if (this.station.length)
|
||||
writer.writeRepeatedMessage(9, this.station, (item: dependency_1.state.Station) => item.serialize(writer));
|
||||
if (this.entry.length)
|
||||
writer.writeRepeatedMessage(10, this.entry, (item: dependency_1.state.Entry) => item.serialize(writer));
|
||||
if (this.scada.length)
|
||||
writer.writeRepeatedMessage(11, this.scada, (item: dependency_1.state.Scada) => item.serialize(writer));
|
||||
if (this.waterProofDoor.length)
|
||||
writer.writeRepeatedMessage(12, this.waterProofDoor, (item: dependency_1.state.WaterProofDoor) => item.serialize(writer));
|
||||
if (this.workArea.length)
|
||||
writer.writeRepeatedMessage(13, this.workArea, (item: dependency_1.state.WorkArea) => item.serialize(writer));
|
||||
if (this.gama.length)
|
||||
writer.writeRepeatedMessage(14, this.gama, (item: dependency_1.state.Gama) => item.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): RtuDevicesStorage {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new RtuDevicesStorage();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.lineId = reader.readInt32();
|
||||
break;
|
||||
case 2:
|
||||
message.rtuId = reader.readInt32();
|
||||
break;
|
||||
case 3:
|
||||
message.all = reader.readBool();
|
||||
break;
|
||||
case 4:
|
||||
reader.readMessage(message.signal, () => pb_1.Message.addToRepeatedWrapperField(message, 4, dependency_1.state.Signal.deserialize(reader), dependency_1.state.Signal));
|
||||
break;
|
||||
case 5:
|
||||
reader.readMessage(message.switch, () => pb_1.Message.addToRepeatedWrapperField(message, 5, dependency_1.state.Switch.deserialize(reader), dependency_1.state.Switch));
|
||||
break;
|
||||
case 6:
|
||||
reader.readMessage(message.platform, () => pb_1.Message.addToRepeatedWrapperField(message, 6, dependency_1.state.Platform.deserialize(reader), dependency_1.state.Platform));
|
||||
break;
|
||||
case 7:
|
||||
reader.readMessage(message.track, () => pb_1.Message.addToRepeatedWrapperField(message, 7, dependency_1.state.Track.deserialize(reader), dependency_1.state.Track));
|
||||
break;
|
||||
case 8:
|
||||
reader.readMessage(message.rtu, () => pb_1.Message.addToRepeatedWrapperField(message, 8, dependency_1.state.Rtu.deserialize(reader), dependency_1.state.Rtu));
|
||||
break;
|
||||
case 9:
|
||||
reader.readMessage(message.station, () => pb_1.Message.addToRepeatedWrapperField(message, 9, dependency_1.state.Station.deserialize(reader), dependency_1.state.Station));
|
||||
break;
|
||||
case 10:
|
||||
reader.readMessage(message.entry, () => pb_1.Message.addToRepeatedWrapperField(message, 10, dependency_1.state.Entry.deserialize(reader), dependency_1.state.Entry));
|
||||
break;
|
||||
case 11:
|
||||
reader.readMessage(message.scada, () => pb_1.Message.addToRepeatedWrapperField(message, 11, dependency_1.state.Scada.deserialize(reader), dependency_1.state.Scada));
|
||||
break;
|
||||
case 12:
|
||||
reader.readMessage(message.waterProofDoor, () => pb_1.Message.addToRepeatedWrapperField(message, 12, dependency_1.state.WaterProofDoor.deserialize(reader), dependency_1.state.WaterProofDoor));
|
||||
break;
|
||||
case 13:
|
||||
reader.readMessage(message.workArea, () => pb_1.Message.addToRepeatedWrapperField(message, 13, dependency_1.state.WorkArea.deserialize(reader), dependency_1.state.WorkArea));
|
||||
break;
|
||||
case 14:
|
||||
reader.readMessage(message.gama, () => pb_1.Message.addToRepeatedWrapperField(message, 14, dependency_1.state.Gama.deserialize(reader), dependency_1.state.Gama));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary(): Uint8Array {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes: Uint8Array): RtuDevicesStorage {
|
||||
return RtuDevicesStorage.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
export class LineDevicesStorage extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
lineId?: number;
|
||||
all?: boolean;
|
||||
storage?: RtuDevicesStorage[];
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3], this.#one_of_decls);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("lineId" in data && data.lineId != undefined) {
|
||||
this.lineId = data.lineId;
|
||||
}
|
||||
if ("all" in data && data.all != undefined) {
|
||||
this.all = data.all;
|
||||
}
|
||||
if ("storage" in data && data.storage != undefined) {
|
||||
this.storage = data.storage;
|
||||
}
|
||||
}
|
||||
}
|
||||
get lineId() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 1, 0) as number;
|
||||
}
|
||||
set lineId(value: number) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
get all() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 2, false) as boolean;
|
||||
}
|
||||
set all(value: boolean) {
|
||||
pb_1.Message.setField(this, 2, value);
|
||||
}
|
||||
get storage() {
|
||||
return pb_1.Message.getRepeatedWrapperField(this, RtuDevicesStorage, 3) as RtuDevicesStorage[];
|
||||
}
|
||||
set storage(value: RtuDevicesStorage[]) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 3, value);
|
||||
}
|
||||
static fromObject(data: {
|
||||
lineId?: number;
|
||||
all?: boolean;
|
||||
storage?: ReturnType<typeof RtuDevicesStorage.prototype.toObject>[];
|
||||
}): LineDevicesStorage {
|
||||
const message = new LineDevicesStorage({});
|
||||
if (data.lineId != null) {
|
||||
message.lineId = data.lineId;
|
||||
}
|
||||
if (data.all != null) {
|
||||
message.all = data.all;
|
||||
}
|
||||
if (data.storage != null) {
|
||||
message.storage = data.storage.map(item => RtuDevicesStorage.fromObject(item));
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {
|
||||
lineId?: number;
|
||||
all?: boolean;
|
||||
storage?: ReturnType<typeof RtuDevicesStorage.prototype.toObject>[];
|
||||
} = {};
|
||||
if (this.lineId != null) {
|
||||
data.lineId = this.lineId;
|
||||
}
|
||||
if (this.all != null) {
|
||||
data.all = this.all;
|
||||
}
|
||||
if (this.storage != null) {
|
||||
data.storage = this.storage.map((item: RtuDevicesStorage) => item.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.lineId != 0)
|
||||
writer.writeInt32(1, this.lineId);
|
||||
if (this.all != false)
|
||||
writer.writeBool(2, this.all);
|
||||
if (this.storage.length)
|
||||
writer.writeRepeatedMessage(3, this.storage, (item: RtuDevicesStorage) => item.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): LineDevicesStorage {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new LineDevicesStorage();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.lineId = reader.readInt32();
|
||||
break;
|
||||
case 2:
|
||||
message.all = reader.readBool();
|
||||
break;
|
||||
case 3:
|
||||
reader.readMessage(message.storage, () => pb_1.Message.addToRepeatedWrapperField(message, 3, RtuDevicesStorage.deserialize(reader), RtuDevicesStorage));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary(): Uint8Array {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes: Uint8Array): LineDevicesStorage {
|
||||
return LineDevicesStorage.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
}
|
@ -1 +1 @@
|
||||
Subproject commit a8afc44290373cc61ad855327637032102fd10a0
|
||||
Subproject commit 1649bf4b3f1cd539b93af414dcfe4d6e6e7dd70f
|
Loading…
Reference in New Issue
Block a user