物理区段
This commit is contained in:
parent
28ffe0f52b
commit
e1353feb43
@ -1 +1 @@
|
||||
Subproject commit 0a7e6144bad3d943b5adfec4595c70209d8b1127
|
||||
Subproject commit 6899504fef7c623a9539905812aba3a93a58395f
|
@ -66,7 +66,7 @@ function main() {
|
||||
recursiveGenerate(f, [], prepareCmds);
|
||||
});
|
||||
|
||||
console.log(prepareCmds);
|
||||
// console.log(prepareCmds);
|
||||
|
||||
exec(
|
||||
prepareCmds.join(' && '),
|
||||
|
@ -7,7 +7,14 @@
|
||||
@blur="onUpdate"
|
||||
label="编号"
|
||||
/>
|
||||
<q-field class="q-mt-lg" outlined label="关联区段" readonly stack-label>
|
||||
<q-field
|
||||
v-if="!isTurnoutPhysicalSection"
|
||||
class="q-mt-lg"
|
||||
outlined
|
||||
label="关联区段"
|
||||
readonly
|
||||
stack-label
|
||||
>
|
||||
<template #control>
|
||||
<q-chip
|
||||
color="primary"
|
||||
@ -19,7 +26,14 @@
|
||||
>
|
||||
</template>
|
||||
</q-field>
|
||||
<q-field class="q-mt-lg" outlined label="关联道岔" readonly stack-label>
|
||||
<q-field
|
||||
v-if="!isTurnoutPhysicalSection"
|
||||
class="q-mt-lg"
|
||||
outlined
|
||||
label="关联道岔"
|
||||
readonly
|
||||
stack-label
|
||||
>
|
||||
<template #control>
|
||||
<q-chip
|
||||
color="primary"
|
||||
@ -31,16 +45,28 @@
|
||||
>
|
||||
</template>
|
||||
</q-field>
|
||||
<q-field class="q-mt-lg" outlined label="计轴列表" readonly stack-label>
|
||||
<template #control>
|
||||
<q-chip
|
||||
color="primary"
|
||||
text-color="white"
|
||||
v-for="code in axleCountingRelations"
|
||||
:key="code"
|
||||
square
|
||||
>{{ code }}</q-chip
|
||||
>
|
||||
</template>
|
||||
</q-field>
|
||||
</q-form>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { SectionData } from 'src/drawApp/graphics/SectionInteraction';
|
||||
import { AxleCounting } from 'src/graphics/axleCounting/AxleCounting';
|
||||
import { Section, SectionType } from 'src/graphics/section/Section';
|
||||
import { Turnout } from 'src/graphics/turnout/Turnout';
|
||||
import { graphicData } from 'src/protos/stationLayoutGraphics';
|
||||
import { useDrawStore } from 'src/stores/draw-store';
|
||||
import { computed, ref, shallowRef, toRaw, watchEffect } from 'vue';
|
||||
import { computed, shallowRef, watchEffect } from 'vue';
|
||||
|
||||
const drawStore = useDrawStore();
|
||||
|
||||
@ -78,6 +104,24 @@ const turnoutRelations = computed(() => {
|
||||
);
|
||||
});
|
||||
|
||||
const isTurnoutPhysicalSection = computed(() => {
|
||||
const section = drawStore.selectedGraphic as Section;
|
||||
|
||||
return section.datas.sectionType === SectionType.TurnoutPhysical;
|
||||
});
|
||||
|
||||
const axleCountingRelations = computed(() => {
|
||||
const section = drawStore.selectedGraphic as Section;
|
||||
|
||||
const axleCountingRelations =
|
||||
section.relationManage.getRelationsOfGraphicAndOtherType(
|
||||
section,
|
||||
AxleCounting.Type
|
||||
);
|
||||
return axleCountingRelations.map(
|
||||
(relation) => relation.getOtherGraphic<AxleCounting>(section).datas.code
|
||||
);
|
||||
});
|
||||
watchEffect(() => {
|
||||
const section = drawStore.selectedGraphic;
|
||||
if (section && section instanceof Section) {
|
||||
|
51
src/drawApp/graphics/LogicSectionInteraction.ts
Normal file
51
src/drawApp/graphics/LogicSectionInteraction.ts
Normal file
@ -0,0 +1,51 @@
|
||||
import {
|
||||
ILogicSectionData,
|
||||
LogicSection,
|
||||
} from 'src/graphics/logicSection/LogicSection';
|
||||
import * as pb_1 from 'google-protobuf';
|
||||
import { GraphicDataBase } from './GraphicDataBase';
|
||||
import { graphicData } from 'src/protos/stationLayoutGraphics';
|
||||
import { IPointData } from 'pixi.js';
|
||||
|
||||
export class LogicSectionData
|
||||
extends GraphicDataBase
|
||||
implements ILogicSectionData
|
||||
{
|
||||
constructor(data?: graphicData.Section) {
|
||||
let section;
|
||||
if (!data) {
|
||||
section = new graphicData.Section({
|
||||
common: GraphicDataBase.defaultCommonInfo(LogicSection.Type),
|
||||
});
|
||||
} else {
|
||||
section = data;
|
||||
}
|
||||
super(section);
|
||||
}
|
||||
public get data(): graphicData.Section {
|
||||
return this.getData<graphicData.Section>();
|
||||
}
|
||||
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 })
|
||||
);
|
||||
}
|
||||
clone(): LogicSectionData {
|
||||
return new LogicSectionData(this.data.cloneMessage());
|
||||
}
|
||||
copyFrom(data: LogicSectionData): void {
|
||||
pb_1.Message.copyInto(data.data, this.data);
|
||||
}
|
||||
eq(other: LogicSectionData): boolean {
|
||||
return pb_1.Message.equals(this.data, other.data);
|
||||
}
|
||||
}
|
@ -51,6 +51,12 @@ export class SectionData extends GraphicDataBase implements ISectionData {
|
||||
set sectionType(type: graphicData.Section.SectionType) {
|
||||
this.data.sectionType = type;
|
||||
}
|
||||
get axleCountings(): string[] {
|
||||
return this.data.axleCountings;
|
||||
}
|
||||
set axleCountings(axleCountings: string[]) {
|
||||
this.data.axleCountings = axleCountings;
|
||||
}
|
||||
get children(): string[] {
|
||||
return this.data.children;
|
||||
}
|
||||
|
@ -82,6 +82,9 @@ import { toStorageTransform } from './graphics/GraphicDataBase';
|
||||
import { SeparatorDraw } from 'src/graphics/separator/SeparatorDrawAssistant';
|
||||
import { Separator, SeparatorTemplate } from 'src/graphics/separator/Separator';
|
||||
import { SeparatorData } from './graphics/SeparatorInteraction';
|
||||
import { LogicSectionDraw } from 'src/graphics/logicSection/LogicSectionDrawAssistant';
|
||||
import { LogicSectionTemplate } from 'src/graphics/logicSection/LogicSection';
|
||||
import { LogicSectionData } from './graphics/LogicSectionInteraction';
|
||||
|
||||
// export function fromStoragePoint(p: graphicData.Point): Point {
|
||||
// return new Point(p.x, p.y);
|
||||
@ -166,6 +169,7 @@ export function initDrawApp(dom: HTMLElement): JlDrawApp {
|
||||
| TurnoutDraw
|
||||
| RunLineDraw
|
||||
| SectionDraw
|
||||
| LogicSectionDraw
|
||||
| StationLineDraw
|
||||
| RectDraw
|
||||
| TrainLineDraw
|
||||
@ -192,6 +196,10 @@ export function initDrawApp(dom: HTMLElement): JlDrawApp {
|
||||
),
|
||||
new TrainDraw(app, new TrainTemplate(new TrainData(), new TrainState())),
|
||||
new SectionDraw(app, new SectionTemplate(new SectionData())),
|
||||
new LogicSectionDraw(
|
||||
app,
|
||||
new LogicSectionTemplate(new LogicSectionData())
|
||||
),
|
||||
new TurnoutDraw(
|
||||
app,
|
||||
new TurnoutTemplate(new TurnoutData(), new TurnoutStates())
|
||||
|
93
src/graphics/logicSection/LogicSection.ts
Normal file
93
src/graphics/logicSection/LogicSection.ts
Normal file
@ -0,0 +1,93 @@
|
||||
import { Graphics, IPointData } from 'pixi.js';
|
||||
import {
|
||||
GraphicData,
|
||||
JlGraphic,
|
||||
JlGraphicTemplate,
|
||||
VectorText,
|
||||
} from 'src/jl-graphic';
|
||||
import { ILineGraphic } from 'src/jl-graphic/plugins/GraphicEditPlugin';
|
||||
import { SectionConsts } from '../section/Section';
|
||||
|
||||
export interface ILogicSectionData extends GraphicData {
|
||||
get code(): string; // 编号
|
||||
set code(v: string);
|
||||
get points(): IPointData[]; // 线坐标点
|
||||
set points(points: IPointData[]);
|
||||
clone(): ILogicSectionData;
|
||||
copyFrom(data: ILogicSectionData): void;
|
||||
eq(other: ILogicSectionData): boolean;
|
||||
}
|
||||
|
||||
export class LogicSection extends JlGraphic implements ILineGraphic {
|
||||
static Type = 'LogicSection';
|
||||
lineGraphic: Graphics;
|
||||
labelGraphic: VectorText;
|
||||
|
||||
constructor() {
|
||||
super(LogicSection.Type);
|
||||
this.lineGraphic = new Graphics();
|
||||
this.labelGraphic = new VectorText();
|
||||
this.labelGraphic.setVectorFontSize(14);
|
||||
this.labelGraphic.anchor.set(0.5);
|
||||
this.labelGraphic.style.fill = '#0f0';
|
||||
this.labelGraphic.transformSave = true;
|
||||
this.labelGraphic.name = 'label';
|
||||
this.transformSave = true;
|
||||
this.addChild(this.lineGraphic);
|
||||
this.addChild(this.labelGraphic);
|
||||
}
|
||||
|
||||
get datas(): ILogicSectionData {
|
||||
return this.getDatas<ILogicSectionData>();
|
||||
}
|
||||
get linePoints(): IPointData[] {
|
||||
return this.datas.points;
|
||||
}
|
||||
set linePoints(points: IPointData[]) {
|
||||
const old = this.datas.clone();
|
||||
old.points = points;
|
||||
this.updateData(old);
|
||||
}
|
||||
|
||||
doRepaint() {
|
||||
if (this.datas.points.length < 2) {
|
||||
throw new Error('Link坐标数据异常');
|
||||
}
|
||||
|
||||
this.lineGraphic.clear();
|
||||
this.lineGraphic.lineStyle(
|
||||
SectionConsts.lineWidth,
|
||||
SectionConsts.lineColor
|
||||
);
|
||||
|
||||
this.datas.points.forEach((p, i) => {
|
||||
if (i !== 0) {
|
||||
this.lineGraphic.lineTo(p.x, p.y);
|
||||
} else {
|
||||
this.lineGraphic.moveTo(p.x, p.y);
|
||||
}
|
||||
});
|
||||
|
||||
this.labelGraphic.text = this.datas.code;
|
||||
const labelPosition = this.datas.childTransforms?.find(
|
||||
(t) => t.name === this.labelGraphic.name
|
||||
)?.transform.position;
|
||||
if (labelPosition) {
|
||||
this.labelGraphic.position.set(labelPosition.x, labelPosition.y);
|
||||
} else {
|
||||
this.labelGraphic.position.set(
|
||||
this.datas.points[0].x,
|
||||
this.datas.points[0].y + 20
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export class LogicSectionTemplate extends JlGraphicTemplate<LogicSection> {
|
||||
constructor(dataTemplate: ILogicSectionData) {
|
||||
super(LogicSection.Type, { dataTemplate });
|
||||
}
|
||||
new() {
|
||||
return new LogicSection();
|
||||
}
|
||||
}
|
34
src/graphics/logicSection/LogicSectionDrawAssistant.ts
Normal file
34
src/graphics/logicSection/LogicSectionDrawAssistant.ts
Normal file
@ -0,0 +1,34 @@
|
||||
import { GraphicDrawAssistant, JlDrawApp } from 'src/jl-graphic';
|
||||
import { LogicSectionTemplate } from './LogicSection';
|
||||
import { LogicSectionData } from 'src/drawApp/graphics/LogicSectionInteraction';
|
||||
import { Graphics, Point } from 'pixi.js';
|
||||
import { SectionConsts } from '../section/Section';
|
||||
|
||||
export class LogicSectionDraw extends GraphicDrawAssistant<
|
||||
LogicSectionTemplate,
|
||||
LogicSectionData
|
||||
> {
|
||||
points: Point[] = [];
|
||||
graphic = new Graphics();
|
||||
constructor(app: JlDrawApp, template: LogicSectionTemplate) {
|
||||
super(app, template, 'sym_o_timeline', '不展示');
|
||||
this.container.addChild(this.graphic);
|
||||
}
|
||||
redraw(cp: Point): void {
|
||||
if (this.points.length < 1) return;
|
||||
this.graphic.clear();
|
||||
this.graphic.lineStyle(SectionConsts.lineWidth, SectionConsts.lineColor);
|
||||
this.points.forEach((p, i) => {
|
||||
if (i !== 0) {
|
||||
this.graphic.lineTo(p.x, p.y);
|
||||
} else {
|
||||
this.graphic.moveTo(p.x, p.y);
|
||||
}
|
||||
});
|
||||
this.graphic.lineTo(cp.x, cp.y);
|
||||
}
|
||||
|
||||
prepareData(data: LogicSectionData): boolean {
|
||||
return true;
|
||||
}
|
||||
}
|
@ -16,12 +16,11 @@ import {
|
||||
protoPort2Data,
|
||||
} from '../CommonGraphics';
|
||||
import { Turnout } from '../turnout/Turnout';
|
||||
import { SectionData } from 'src/drawApp/graphics/SectionInteraction';
|
||||
import Vector2 from 'src/jl-graphic/math/Vector2';
|
||||
import { AxleCounting } from '../axleCounting/AxleCounting';
|
||||
|
||||
export enum SectionType {
|
||||
Physical = 0,
|
||||
Logic = 1,
|
||||
TurnoutPhysical = 2,
|
||||
}
|
||||
|
||||
@ -41,6 +40,8 @@ export interface ISectionData extends GraphicData {
|
||||
set pbRef(ref: IRelatedRefData | undefined);
|
||||
get sectionType(): SectionType;
|
||||
set sectionType(type: SectionType);
|
||||
get axleCountings(): string[];
|
||||
set axleCountings(axleCountings: string[]);
|
||||
get children(): string[];
|
||||
set children(children: string[]);
|
||||
clone(): ISectionData;
|
||||
@ -82,7 +83,10 @@ export class Section extends JlGraphic implements ILineGraphic {
|
||||
}
|
||||
|
||||
this.lineGraphic.clear();
|
||||
if (this.datas.sectionType === SectionType.Physical) {
|
||||
if (
|
||||
this.datas.sectionType === SectionType.Physical &&
|
||||
!(this.datas.children?.length > 0)
|
||||
) {
|
||||
this.lineGraphic.lineStyle(
|
||||
SectionConsts.lineWidth,
|
||||
SectionConsts.lineColor
|
||||
@ -285,6 +289,14 @@ export class Section extends JlGraphic implements ILineGraphic {
|
||||
)
|
||||
);
|
||||
}
|
||||
if (this.datas.axleCountings) {
|
||||
this.datas.axleCountings.forEach((acId) => {
|
||||
this.relationManage.addRelation(
|
||||
this,
|
||||
this.queryStore.queryById<AxleCounting>(acId)
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -49,6 +49,9 @@ import { SectionData } from 'src/drawApp/graphics/SectionInteraction';
|
||||
import { graphicData } from 'src/protos/stationLayoutGraphics';
|
||||
import SectionSplitDialog from 'src/components/draw-app/dialogs/SectionSplitDialog.vue';
|
||||
import { AxleCounting } from '../axleCounting/AxleCounting';
|
||||
import { LogicSectionData } from 'src/drawApp/graphics/LogicSectionInteraction';
|
||||
import { LogicSectionDraw } from '../logicSection/LogicSectionDrawAssistant';
|
||||
import { LogicSection } from '../logicSection/LogicSection';
|
||||
|
||||
export class SectionDraw extends GraphicDrawAssistant<
|
||||
SectionTemplate,
|
||||
@ -172,13 +175,16 @@ export class SectionDraw extends GraphicDrawAssistant<
|
||||
turnoutPhysicalSectionData.axleCountings = result.axleCountings.map(
|
||||
(ac) => ac.datas.id
|
||||
);
|
||||
turnoutPhysicalSectionData.code = result.turnouts
|
||||
.map((t) => t.datas.code)
|
||||
.join('-');
|
||||
const labelPosition = calculateLineMidpoint(
|
||||
turnoutPhysicalSectionData.code = 'DG000';
|
||||
let labelPosition: IPointData;
|
||||
if (result.turnouts.length === 2) {
|
||||
labelPosition = calculateLineMidpoint(
|
||||
result.turnouts[0].position,
|
||||
result.turnouts[1].position
|
||||
);
|
||||
} else {
|
||||
labelPosition = { x: result.turnouts[0].x, y: result.turnouts[0].y };
|
||||
}
|
||||
labelPosition.y += 20;
|
||||
const labelTransform = GraphicTransform.default();
|
||||
labelTransform.position = labelPosition;
|
||||
@ -206,6 +212,11 @@ class SectionGraphicHitArea implements IHitArea {
|
||||
this.section = section;
|
||||
}
|
||||
contains(x: number, y: number): boolean {
|
||||
if (
|
||||
this.section.datas.sectionType === SectionType.Physical &&
|
||||
this.section.datas.children?.length > 0
|
||||
)
|
||||
return false;
|
||||
for (let i = 1; i < this.section.datas.points.length; i++) {
|
||||
const p1 = this.section.datas.points[i - 1];
|
||||
const p2 = this.section.datas.points[i];
|
||||
@ -436,8 +447,8 @@ export class SectionPointEditPlugin extends GraphicInteractionPlugin<Section> {
|
||||
};
|
||||
|
||||
if (
|
||||
section.datas.children &&
|
||||
section.datas.sectionType === SectionType.Physical
|
||||
section.datas.sectionType === SectionType.Physical &&
|
||||
!(section.datas.children?.length > 0)
|
||||
) {
|
||||
splitSectionConfig.disabled = false;
|
||||
splitSectionConfig.handler = () => {
|
||||
@ -451,7 +462,7 @@ export class SectionPointEditPlugin extends GraphicInteractionPlugin<Section> {
|
||||
const { num, dir } = data;
|
||||
const sectionData = section.datas;
|
||||
const points = section.getSplitPoints(num);
|
||||
const children: Section[] = [];
|
||||
const children: LogicSection[] = [];
|
||||
let codeAppend = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.slice(0, num);
|
||||
if (
|
||||
(dir === 'ltr' &&
|
||||
@ -464,14 +475,15 @@ export class SectionPointEditPlugin extends GraphicInteractionPlugin<Section> {
|
||||
codeAppend = codeAppend.split('').reverse().join('');
|
||||
}
|
||||
points.forEach((ps, i) => {
|
||||
const data = new SectionData();
|
||||
data.id = this.drawAssistant.nextId();
|
||||
data.code = `${sectionData.code}-${codeAppend.charAt(i % 26)}`;
|
||||
data.sectionType = SectionType.Logic;
|
||||
const data = new LogicSectionData();
|
||||
const logicSectionDA = this.drawAssistant.app.drawAssistants.find(
|
||||
(da) => da instanceof LogicSectionDraw
|
||||
) as LogicSectionDraw;
|
||||
data.id = logicSectionDA.nextId();
|
||||
data.code = `${codeAppend.charAt(i % 26)}`;
|
||||
data.points = ps.map(
|
||||
(p) => new graphicData.Point({ x: p.x, y: p.y })
|
||||
);
|
||||
data.id = this.drawAssistant.nextId();
|
||||
data.childTransforms = [
|
||||
new ChildTransform(
|
||||
'label',
|
||||
@ -491,9 +503,9 @@ export class SectionPointEditPlugin extends GraphicInteractionPlugin<Section> {
|
||||
)
|
||||
),
|
||||
];
|
||||
const g = this.drawAssistant.graphicTemplate.new();
|
||||
const g = logicSectionDA.graphicTemplate.new();
|
||||
g.loadData(data);
|
||||
this.drawAssistant.storeGraphic(g);
|
||||
logicSectionDA.storeGraphic(g);
|
||||
children.push(g);
|
||||
});
|
||||
sectionData.children = children.map((g) => g.datas.id);
|
||||
@ -513,10 +525,7 @@ export class SectionPointEditPlugin extends GraphicInteractionPlugin<Section> {
|
||||
|
||||
onSelected(g: DisplayObject): void {
|
||||
const section = g as Section;
|
||||
if (
|
||||
section.datas.children.length > 0 &&
|
||||
section.datas.sectionType === SectionType.Physical
|
||||
) {
|
||||
if (section.datas.sectionType === SectionType.TurnoutPhysical) {
|
||||
return;
|
||||
}
|
||||
let lep = section.getAssistantAppend<SectionPolylineEditPlugin>(
|
||||
|
@ -4,7 +4,7 @@
|
||||
* source: alertInfo.proto
|
||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||
import * as pb_1 from "google-protobuf";
|
||||
export namespace state {
|
||||
export namespace alert {
|
||||
export class NccAlertInfoMessage extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
@ -81,6 +81,8 @@ export namespace state {
|
||||
alert_time?: string;
|
||||
info?: string;
|
||||
alert_tip_id?: number;
|
||||
device_info?: string;
|
||||
reason?: string;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||
@ -100,6 +102,12 @@ export namespace state {
|
||||
if ("alert_tip_id" in data && data.alert_tip_id != undefined) {
|
||||
this.alert_tip_id = data.alert_tip_id;
|
||||
}
|
||||
if ("device_info" in data && data.device_info != undefined) {
|
||||
this.device_info = data.device_info;
|
||||
}
|
||||
if ("reason" in data && data.reason != undefined) {
|
||||
this.reason = data.reason;
|
||||
}
|
||||
}
|
||||
}
|
||||
get id() {
|
||||
@ -132,12 +140,26 @@ export namespace state {
|
||||
set alert_tip_id(value: number) {
|
||||
pb_1.Message.setField(this, 5, value);
|
||||
}
|
||||
get device_info() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 6, "") as string;
|
||||
}
|
||||
set device_info(value: string) {
|
||||
pb_1.Message.setField(this, 6, value);
|
||||
}
|
||||
get reason() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 7, "") as string;
|
||||
}
|
||||
set reason(value: string) {
|
||||
pb_1.Message.setField(this, 7, value);
|
||||
}
|
||||
static fromObject(data: {
|
||||
id?: string;
|
||||
level?: string;
|
||||
alert_time?: string;
|
||||
info?: string;
|
||||
alert_tip_id?: number;
|
||||
device_info?: string;
|
||||
reason?: string;
|
||||
}): Message {
|
||||
const message = new Message({});
|
||||
if (data.id != null) {
|
||||
@ -155,6 +177,12 @@ export namespace state {
|
||||
if (data.alert_tip_id != null) {
|
||||
message.alert_tip_id = data.alert_tip_id;
|
||||
}
|
||||
if (data.device_info != null) {
|
||||
message.device_info = data.device_info;
|
||||
}
|
||||
if (data.reason != null) {
|
||||
message.reason = data.reason;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
@ -164,6 +192,8 @@ export namespace state {
|
||||
alert_time?: string;
|
||||
info?: string;
|
||||
alert_tip_id?: number;
|
||||
device_info?: string;
|
||||
reason?: string;
|
||||
} = {};
|
||||
if (this.id != null) {
|
||||
data.id = this.id;
|
||||
@ -180,6 +210,12 @@ export namespace state {
|
||||
if (this.alert_tip_id != null) {
|
||||
data.alert_tip_id = this.alert_tip_id;
|
||||
}
|
||||
if (this.device_info != null) {
|
||||
data.device_info = this.device_info;
|
||||
}
|
||||
if (this.reason != null) {
|
||||
data.reason = this.reason;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
@ -196,6 +232,10 @@ export namespace state {
|
||||
writer.writeString(4, this.info);
|
||||
if (this.alert_tip_id != 0)
|
||||
writer.writeInt32(5, this.alert_tip_id);
|
||||
if (this.device_info.length)
|
||||
writer.writeString(6, this.device_info);
|
||||
if (this.reason.length)
|
||||
writer.writeString(7, this.reason);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
@ -220,6 +260,12 @@ export namespace state {
|
||||
case 5:
|
||||
message.alert_tip_id = reader.readInt32();
|
||||
break;
|
||||
case 6:
|
||||
message.device_info = reader.readString();
|
||||
break;
|
||||
case 7:
|
||||
message.reason = reader.readString();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
|
@ -3392,9 +3392,10 @@ export namespace graphicData {
|
||||
pbRef?: RelatedRef;
|
||||
sectionType?: Section.SectionType;
|
||||
axleCountings?: string[];
|
||||
children?: string[];
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3, 7], this.#one_of_decls);
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3, 7, 8], this.#one_of_decls);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("common" in data && data.common != undefined) {
|
||||
this.common = data.common;
|
||||
@ -3417,6 +3418,9 @@ export namespace graphicData {
|
||||
if ("axleCountings" in data && data.axleCountings != undefined) {
|
||||
this.axleCountings = data.axleCountings;
|
||||
}
|
||||
if ("children" in data && data.children != undefined) {
|
||||
this.children = data.children;
|
||||
}
|
||||
}
|
||||
}
|
||||
get common() {
|
||||
@ -3470,6 +3474,12 @@ export namespace graphicData {
|
||||
set axleCountings(value: string[]) {
|
||||
pb_1.Message.setField(this, 7, value);
|
||||
}
|
||||
get children() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 8, []) as string[];
|
||||
}
|
||||
set children(value: string[]) {
|
||||
pb_1.Message.setField(this, 8, value);
|
||||
}
|
||||
static fromObject(data: {
|
||||
common?: ReturnType<typeof CommonInfo.prototype.toObject>;
|
||||
code?: string;
|
||||
@ -3478,6 +3488,7 @@ export namespace graphicData {
|
||||
pbRef?: ReturnType<typeof RelatedRef.prototype.toObject>;
|
||||
sectionType?: Section.SectionType;
|
||||
axleCountings?: string[];
|
||||
children?: string[];
|
||||
}): Section {
|
||||
const message = new Section({});
|
||||
if (data.common != null) {
|
||||
@ -3501,6 +3512,9 @@ export namespace graphicData {
|
||||
if (data.axleCountings != null) {
|
||||
message.axleCountings = data.axleCountings;
|
||||
}
|
||||
if (data.children != null) {
|
||||
message.children = data.children;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
@ -3512,6 +3526,7 @@ export namespace graphicData {
|
||||
pbRef?: ReturnType<typeof RelatedRef.prototype.toObject>;
|
||||
sectionType?: Section.SectionType;
|
||||
axleCountings?: string[];
|
||||
children?: string[];
|
||||
} = {};
|
||||
if (this.common != null) {
|
||||
data.common = this.common.toObject();
|
||||
@ -3534,6 +3549,9 @@ export namespace graphicData {
|
||||
if (this.axleCountings != null) {
|
||||
data.axleCountings = this.axleCountings;
|
||||
}
|
||||
if (this.children != null) {
|
||||
data.children = this.children;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
@ -3554,6 +3572,8 @@ export namespace graphicData {
|
||||
writer.writeEnum(6, this.sectionType);
|
||||
if (this.axleCountings.length)
|
||||
writer.writeRepeatedString(7, this.axleCountings);
|
||||
if (this.children.length)
|
||||
writer.writeRepeatedString(8, this.children);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
@ -3584,6 +3604,9 @@ export namespace graphicData {
|
||||
case 7:
|
||||
pb_1.Message.addToRepeatedField(message, 7, reader.readString());
|
||||
break;
|
||||
case 8:
|
||||
pb_1.Message.addToRepeatedField(message, 8, reader.readString());
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
@ -3599,10 +3622,125 @@ export namespace graphicData {
|
||||
export namespace Section {
|
||||
export enum SectionType {
|
||||
Physical = 0,
|
||||
Logic = 1,
|
||||
TurnoutPhysical = 2
|
||||
}
|
||||
}
|
||||
export class LogicSection 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>[];
|
||||
}): LogicSection {
|
||||
const message = new LogicSection({});
|
||||
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): LogicSection {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new LogicSection();
|
||||
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): LogicSection {
|
||||
return LogicSection.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
export class KilometerPoint extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
@ -3727,7 +3865,7 @@ export namespace graphicData {
|
||||
points?: Point[];
|
||||
isUp?: boolean;
|
||||
kilometerPoints?: KilometerPoint[];
|
||||
aToB?: boolean;
|
||||
isKmIncrease?: boolean;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3, 5], this.#one_of_decls);
|
||||
@ -3747,8 +3885,8 @@ export namespace graphicData {
|
||||
if ("kilometerPoints" in data && data.kilometerPoints != undefined) {
|
||||
this.kilometerPoints = data.kilometerPoints;
|
||||
}
|
||||
if ("aToB" in data && data.aToB != undefined) {
|
||||
this.aToB = data.aToB;
|
||||
if ("isKmIncrease" in data && data.isKmIncrease != undefined) {
|
||||
this.isKmIncrease = data.isKmIncrease;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3785,10 +3923,10 @@ export namespace graphicData {
|
||||
set kilometerPoints(value: KilometerPoint[]) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 5, value);
|
||||
}
|
||||
get aToB() {
|
||||
get isKmIncrease() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 6, false) as boolean;
|
||||
}
|
||||
set aToB(value: boolean) {
|
||||
set isKmIncrease(value: boolean) {
|
||||
pb_1.Message.setField(this, 6, value);
|
||||
}
|
||||
static fromObject(data: {
|
||||
@ -3797,7 +3935,7 @@ export namespace graphicData {
|
||||
points?: ReturnType<typeof Point.prototype.toObject>[];
|
||||
isUp?: boolean;
|
||||
kilometerPoints?: ReturnType<typeof KilometerPoint.prototype.toObject>[];
|
||||
aToB?: boolean;
|
||||
isKmIncrease?: boolean;
|
||||
}): PathLine {
|
||||
const message = new PathLine({});
|
||||
if (data.common != null) {
|
||||
@ -3815,8 +3953,8 @@ export namespace graphicData {
|
||||
if (data.kilometerPoints != null) {
|
||||
message.kilometerPoints = data.kilometerPoints.map(item => KilometerPoint.fromObject(item));
|
||||
}
|
||||
if (data.aToB != null) {
|
||||
message.aToB = data.aToB;
|
||||
if (data.isKmIncrease != null) {
|
||||
message.isKmIncrease = data.isKmIncrease;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
@ -3827,7 +3965,7 @@ export namespace graphicData {
|
||||
points?: ReturnType<typeof Point.prototype.toObject>[];
|
||||
isUp?: boolean;
|
||||
kilometerPoints?: ReturnType<typeof KilometerPoint.prototype.toObject>[];
|
||||
aToB?: boolean;
|
||||
isKmIncrease?: boolean;
|
||||
} = {};
|
||||
if (this.common != null) {
|
||||
data.common = this.common.toObject();
|
||||
@ -3844,8 +3982,8 @@ export namespace graphicData {
|
||||
if (this.kilometerPoints != null) {
|
||||
data.kilometerPoints = this.kilometerPoints.map((item: KilometerPoint) => item.toObject());
|
||||
}
|
||||
if (this.aToB != null) {
|
||||
data.aToB = this.aToB;
|
||||
if (this.isKmIncrease != null) {
|
||||
data.isKmIncrease = this.isKmIncrease;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
@ -3863,8 +4001,8 @@ export namespace graphicData {
|
||||
writer.writeBool(4, this.isUp);
|
||||
if (this.kilometerPoints.length)
|
||||
writer.writeRepeatedMessage(5, this.kilometerPoints, (item: KilometerPoint) => item.serialize(writer));
|
||||
if (this.aToB != false)
|
||||
writer.writeBool(6, this.aToB);
|
||||
if (this.isKmIncrease != false)
|
||||
writer.writeBool(6, this.isKmIncrease);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
@ -3890,7 +4028,7 @@ export namespace graphicData {
|
||||
reader.readMessage(message.kilometerPoints, () => pb_1.Message.addToRepeatedWrapperField(message, 5, KilometerPoint.deserialize(reader), KilometerPoint));
|
||||
break;
|
||||
case 6:
|
||||
message.aToB = reader.readBool();
|
||||
message.isKmIncrease = reader.readBool();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 6c2387311aa3c744e380e772df9cba6a49ace989
|
||||
Subproject commit a91685b8deaa6390480ad4ce735898f7ceb5bf1a
|
Loading…
Reference in New Issue
Block a user