信号机添加关联设备
This commit is contained in:
parent
c0219744ff
commit
ff655373ed
@ -7,6 +7,35 @@
|
|||||||
@blur="onUpdate"
|
@blur="onUpdate"
|
||||||
label="编号"
|
label="编号"
|
||||||
/>
|
/>
|
||||||
|
<q-select
|
||||||
|
outlined
|
||||||
|
class="q-mt-sm"
|
||||||
|
v-model="refDevData.deviceType"
|
||||||
|
:options="DeviceTypeOptions"
|
||||||
|
readonly
|
||||||
|
map-options
|
||||||
|
emit-value
|
||||||
|
label="关联设备类型:"
|
||||||
|
></q-select>
|
||||||
|
<q-input
|
||||||
|
outlined
|
||||||
|
class="q-mt-sm"
|
||||||
|
v-model="refDevData.code"
|
||||||
|
:readonly="true"
|
||||||
|
label="关联设备:"
|
||||||
|
></q-input>
|
||||||
|
<q-select
|
||||||
|
outlined
|
||||||
|
v-if="refDevData.deviceType === graphicData.RelatedRef.DeviceType.Turnout"
|
||||||
|
class="q-mt-sm"
|
||||||
|
v-model="refDevData.devicePort"
|
||||||
|
:options="DevicePortOptions"
|
||||||
|
:readonly="true"
|
||||||
|
:map-options="true"
|
||||||
|
:emit-value="true"
|
||||||
|
@update:model-value="onUpdate"
|
||||||
|
label="关联设备端口:"
|
||||||
|
></q-select>
|
||||||
<q-select
|
<q-select
|
||||||
outlined
|
outlined
|
||||||
style="margin-top: 10px"
|
style="margin-top: 10px"
|
||||||
@ -31,7 +60,11 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useFormData } from 'src/components/DrawAppFormUtils';
|
import { useFormData } from 'src/components/DrawAppFormUtils';
|
||||||
import { SignalData } from 'src/drawApp/graphics/SignalInteraction';
|
import { SignalData } from 'src/drawApp/graphics/SignalInteraction';
|
||||||
|
import { Section } 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 { useDrawStore } from 'src/stores/draw-store';
|
||||||
|
import { computed } from 'vue';
|
||||||
|
|
||||||
const drawStore = useDrawStore();
|
const drawStore = useDrawStore();
|
||||||
const { data: signalModel, onUpdate } = useFormData(
|
const { data: signalModel, onUpdate } = useFormData(
|
||||||
@ -39,6 +72,35 @@ const { data: signalModel, onUpdate } = useFormData(
|
|||||||
drawStore.getDrawApp()
|
drawStore.getDrawApp()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const refDevData = computed(() => {
|
||||||
|
console.log(signalModel, '====');
|
||||||
|
return signalModel.refDevice
|
||||||
|
? {
|
||||||
|
...signalModel.refDevice.toObject(),
|
||||||
|
code: drawStore
|
||||||
|
.getDrawApp()
|
||||||
|
.queryStore.queryById<Section | Turnout>(signalModel.refDevice.id)
|
||||||
|
.datas.code,
|
||||||
|
}
|
||||||
|
: {
|
||||||
|
id: 0,
|
||||||
|
deviceType: graphicData.RelatedRef.DeviceType.Section,
|
||||||
|
devicePort: graphicData.RelatedRef.DevicePort.A,
|
||||||
|
code: '',
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
const DeviceTypeOptions = [
|
||||||
|
{ label: '区段', value: graphicData.RelatedRef.DeviceType.Section },
|
||||||
|
{ label: '道岔', value: graphicData.RelatedRef.DeviceType.Turnout },
|
||||||
|
];
|
||||||
|
|
||||||
|
const DevicePortOptions = [
|
||||||
|
{ label: 'A端', value: graphicData.RelatedRef.DevicePort.A },
|
||||||
|
{ label: 'B端', value: graphicData.RelatedRef.DevicePort.B },
|
||||||
|
{ label: 'C端', value: graphicData.RelatedRef.DevicePort.C },
|
||||||
|
];
|
||||||
|
|
||||||
const CoordinateSystemOptions = [
|
const CoordinateSystemOptions = [
|
||||||
{ label: '车辆段', value: 'DEPOT' },
|
{ label: '车辆段', value: 'DEPOT' },
|
||||||
{ label: '停车场', value: 'PARKING_LOT' },
|
{ label: '停车场', value: 'PARKING_LOT' },
|
||||||
|
@ -47,6 +47,12 @@ export class SignalData extends GraphicDataBase implements ISignalData {
|
|||||||
set mirror(v: boolean) {
|
set mirror(v: boolean) {
|
||||||
this.data.mirror = v;
|
this.data.mirror = v;
|
||||||
}
|
}
|
||||||
|
get refDevice(): graphicData.RelatedRef {
|
||||||
|
return this.data.refDevice;
|
||||||
|
}
|
||||||
|
set refDevice(v: graphicData.RelatedRef) {
|
||||||
|
this.data.refDevice = v;
|
||||||
|
}
|
||||||
get kilometerSystem(): KilometerSystem {
|
get kilometerSystem(): KilometerSystem {
|
||||||
if (!this.data.kilometerSystem) {
|
if (!this.data.kilometerSystem) {
|
||||||
this.data.kilometerSystem = new graphicData.KilometerSystem();
|
this.data.kilometerSystem = new graphicData.KilometerSystem();
|
||||||
|
@ -77,7 +77,7 @@ export function drawArrow(
|
|||||||
|
|
||||||
export function createRelatedRefProto(
|
export function createRelatedRefProto(
|
||||||
type: string,
|
type: string,
|
||||||
id: string,
|
id: number,
|
||||||
port?: TurnoutPort | SectionPort
|
port?: TurnoutPort | SectionPort
|
||||||
) {
|
) {
|
||||||
const typeMap = new Map([
|
const typeMap = new Map([
|
||||||
|
@ -5,11 +5,20 @@ import {
|
|||||||
JlGraphic,
|
JlGraphic,
|
||||||
JlGraphicTemplate,
|
JlGraphicTemplate,
|
||||||
calculateMirrorPoint,
|
calculateMirrorPoint,
|
||||||
|
calculateDistanceFromPointToLine,
|
||||||
|
calculateFootPointFromPointToLine,
|
||||||
|
isPointOnLine,
|
||||||
} from 'jl-graphic';
|
} from 'jl-graphic';
|
||||||
import { LampMainBody } from './LampMainBody';
|
import { LampMainBody } from './LampMainBody';
|
||||||
import { drawArrow } from '../CommonGraphics';
|
import {
|
||||||
|
createRelatedRefProto,
|
||||||
|
drawArrow,
|
||||||
|
IRelatedRefData,
|
||||||
|
} from '../CommonGraphics';
|
||||||
import { SignalCode } from './SignalCode';
|
import { SignalCode } from './SignalCode';
|
||||||
import { Station } from '../station/Station';
|
import { Station } from '../station/Station';
|
||||||
|
import { Turnout, TurnoutPort } from '../turnout/Turnout';
|
||||||
|
import { Section, SectionPort } from '../section/Section';
|
||||||
|
|
||||||
export interface KilometerSystem {
|
export interface KilometerSystem {
|
||||||
get coordinateSystem(): string;
|
get coordinateSystem(): string;
|
||||||
@ -25,6 +34,8 @@ export interface ISignalData extends GraphicData {
|
|||||||
set mirror(v: boolean);
|
set mirror(v: boolean);
|
||||||
get kilometerSystem(): KilometerSystem;
|
get kilometerSystem(): KilometerSystem;
|
||||||
set kilometerSystem(v: KilometerSystem);
|
set kilometerSystem(v: KilometerSystem);
|
||||||
|
get refDevice(): IRelatedRefData | undefined;
|
||||||
|
set refDevice(v: IRelatedRefData | undefined);
|
||||||
clone(): ISignalData;
|
clone(): ISignalData;
|
||||||
copyFrom(data: ISignalData): void;
|
copyFrom(data: ISignalData): void;
|
||||||
eq(other: ISignalData): boolean;
|
eq(other: ISignalData): boolean;
|
||||||
@ -206,6 +217,91 @@ export class Signal extends JlGraphic {
|
|||||||
}
|
}
|
||||||
this.humanControl.endFill();
|
this.humanControl.endFill();
|
||||||
}
|
}
|
||||||
|
buildRelation() {
|
||||||
|
const sections = this.queryStore.queryByType<Section>(Section.Type);
|
||||||
|
const turnouts = this.queryStore.queryByType<Turnout>(Turnout.Type);
|
||||||
|
let deviceId = 0;
|
||||||
|
let deviceType = '';
|
||||||
|
let minD = Number.MAX_SAFE_INTEGER;
|
||||||
|
let port: SectionPort | TurnoutPort | undefined = undefined;
|
||||||
|
sections.forEach((sec: Section) => {
|
||||||
|
const verticesList = sec.datas.points;
|
||||||
|
for (let i = 0; i < verticesList.length - 1; i++) {
|
||||||
|
const d = calculateDistanceFromPointToLine(
|
||||||
|
sec.localToCanvasPoint(verticesList[i]),
|
||||||
|
sec.localToCanvasPoint(verticesList[i + 1]),
|
||||||
|
this.position
|
||||||
|
);
|
||||||
|
const p = calculateFootPointFromPointToLine(
|
||||||
|
sec.localToCanvasPoint(verticesList[i]),
|
||||||
|
sec.localToCanvasPoint(verticesList[i + 1]),
|
||||||
|
this.position
|
||||||
|
);
|
||||||
|
const onLine = isPointOnLine(
|
||||||
|
sec.localToCanvasPoint(verticesList[i]),
|
||||||
|
sec.localToCanvasPoint(verticesList[i + 1]),
|
||||||
|
p
|
||||||
|
);
|
||||||
|
if (onLine && d < minD) {
|
||||||
|
minD = d;
|
||||||
|
deviceId = sec.id;
|
||||||
|
deviceType = sec.type;
|
||||||
|
port = SectionPort.A;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
turnouts.forEach((turnout: Turnout) => {
|
||||||
|
for (let i = 0; i < turnout.datas.pointA.length; i++) {
|
||||||
|
const p1 = turnout.localToCanvasPoint(
|
||||||
|
i === 0 ? new Point(0, 0) : turnout.datas.pointA[i - 1]
|
||||||
|
);
|
||||||
|
const p2 = turnout.localToCanvasPoint(turnout.datas.pointA[i]);
|
||||||
|
const d = calculateDistanceFromPointToLine(p1, p2, this.position);
|
||||||
|
const p = calculateFootPointFromPointToLine(p1, p2, this.position);
|
||||||
|
const onLine = isPointOnLine(p1, p2, p);
|
||||||
|
if (onLine && d < minD) {
|
||||||
|
minD = d;
|
||||||
|
deviceId = turnout.id;
|
||||||
|
deviceType = turnout.type;
|
||||||
|
port = TurnoutPort.A;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (let i = 0; i < turnout.datas.pointB.length; i++) {
|
||||||
|
const p1 = turnout.localToCanvasPoint(
|
||||||
|
i === 0 ? new Point(0, 0) : turnout.datas.pointB[i - 1]
|
||||||
|
);
|
||||||
|
const p2 = turnout.localToCanvasPoint(turnout.datas.pointB[i]);
|
||||||
|
const d = calculateDistanceFromPointToLine(p1, p2, this.position);
|
||||||
|
const p = calculateFootPointFromPointToLine(p1, p2, this.position);
|
||||||
|
const onLine = isPointOnLine(p1, p2, p);
|
||||||
|
if (onLine && d < minD) {
|
||||||
|
minD = d;
|
||||||
|
deviceId = turnout.id;
|
||||||
|
deviceType = turnout.type;
|
||||||
|
port = TurnoutPort.B;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (let i = 0; i < turnout.datas.pointC.length; i++) {
|
||||||
|
const p1 = turnout.localToCanvasPoint(
|
||||||
|
i === 0 ? new Point(0, 0) : turnout.datas.pointC[i - 1]
|
||||||
|
);
|
||||||
|
const p2 = turnout.localToCanvasPoint(turnout.datas.pointC[i]);
|
||||||
|
const d = calculateDistanceFromPointToLine(p1, p2, this.position);
|
||||||
|
const p = calculateFootPointFromPointToLine(p1, p2, this.position);
|
||||||
|
const onLine = isPointOnLine(p1, p2, p);
|
||||||
|
if (onLine && d < minD) {
|
||||||
|
minD = d;
|
||||||
|
deviceId = turnout.id;
|
||||||
|
deviceType = turnout.type;
|
||||||
|
port = TurnoutPort.C;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (deviceId) {
|
||||||
|
this.datas.refDevice = createRelatedRefProto(deviceType, deviceId, port);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class SignalTemplate extends JlGraphicTemplate<Signal> {
|
export class SignalTemplate extends JlGraphicTemplate<Signal> {
|
||||||
|
@ -9,10 +9,10 @@ export namespace state {
|
|||||||
export class Section extends pb_1.Message {
|
export class Section extends pb_1.Message {
|
||||||
#one_of_decls: number[][] = [];
|
#one_of_decls: number[][] = [];
|
||||||
constructor(data?: any[] | {
|
constructor(data?: any[] | {
|
||||||
id?: string;
|
id?: number;
|
||||||
code?: string;
|
code?: string;
|
||||||
childrenId?: string[];
|
childrenId?: number[];
|
||||||
physicalSectionId?: string;
|
physicalSectionId?: number;
|
||||||
destinationCode?: string;
|
destinationCode?: string;
|
||||||
kilometer?: DeviceKilometer;
|
kilometer?: DeviceKilometer;
|
||||||
}) {
|
}) {
|
||||||
@ -40,9 +40,9 @@ export namespace state {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
get id() {
|
get id() {
|
||||||
return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
|
return pb_1.Message.getFieldWithDefault(this, 1, 0) as number;
|
||||||
}
|
}
|
||||||
set id(value: string) {
|
set id(value: number) {
|
||||||
pb_1.Message.setField(this, 1, value);
|
pb_1.Message.setField(this, 1, value);
|
||||||
}
|
}
|
||||||
get code() {
|
get code() {
|
||||||
@ -52,15 +52,15 @@ export namespace state {
|
|||||||
pb_1.Message.setField(this, 2, value);
|
pb_1.Message.setField(this, 2, value);
|
||||||
}
|
}
|
||||||
get childrenId() {
|
get childrenId() {
|
||||||
return pb_1.Message.getFieldWithDefault(this, 3, []) as string[];
|
return pb_1.Message.getFieldWithDefault(this, 3, []) as number[];
|
||||||
}
|
}
|
||||||
set childrenId(value: string[]) {
|
set childrenId(value: number[]) {
|
||||||
pb_1.Message.setField(this, 3, value);
|
pb_1.Message.setField(this, 3, value);
|
||||||
}
|
}
|
||||||
get physicalSectionId() {
|
get physicalSectionId() {
|
||||||
return pb_1.Message.getFieldWithDefault(this, 4, "") as string;
|
return pb_1.Message.getFieldWithDefault(this, 4, 0) as number;
|
||||||
}
|
}
|
||||||
set physicalSectionId(value: string) {
|
set physicalSectionId(value: number) {
|
||||||
pb_1.Message.setField(this, 4, value);
|
pb_1.Message.setField(this, 4, value);
|
||||||
}
|
}
|
||||||
get destinationCode() {
|
get destinationCode() {
|
||||||
@ -79,10 +79,10 @@ export namespace state {
|
|||||||
return pb_1.Message.getField(this, 6) != null;
|
return pb_1.Message.getField(this, 6) != null;
|
||||||
}
|
}
|
||||||
static fromObject(data: {
|
static fromObject(data: {
|
||||||
id?: string;
|
id?: number;
|
||||||
code?: string;
|
code?: string;
|
||||||
childrenId?: string[];
|
childrenId?: number[];
|
||||||
physicalSectionId?: string;
|
physicalSectionId?: number;
|
||||||
destinationCode?: string;
|
destinationCode?: string;
|
||||||
kilometer?: ReturnType<typeof DeviceKilometer.prototype.toObject>;
|
kilometer?: ReturnType<typeof DeviceKilometer.prototype.toObject>;
|
||||||
}): Section {
|
}): Section {
|
||||||
@ -109,10 +109,10 @@ export namespace state {
|
|||||||
}
|
}
|
||||||
toObject() {
|
toObject() {
|
||||||
const data: {
|
const data: {
|
||||||
id?: string;
|
id?: number;
|
||||||
code?: string;
|
code?: string;
|
||||||
childrenId?: string[];
|
childrenId?: number[];
|
||||||
physicalSectionId?: string;
|
physicalSectionId?: number;
|
||||||
destinationCode?: string;
|
destinationCode?: string;
|
||||||
kilometer?: ReturnType<typeof DeviceKilometer.prototype.toObject>;
|
kilometer?: ReturnType<typeof DeviceKilometer.prototype.toObject>;
|
||||||
} = {};
|
} = {};
|
||||||
@ -140,14 +140,14 @@ export namespace state {
|
|||||||
serialize(w: pb_1.BinaryWriter): void;
|
serialize(w: pb_1.BinaryWriter): void;
|
||||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||||
const writer = w || new pb_1.BinaryWriter();
|
const writer = w || new pb_1.BinaryWriter();
|
||||||
if (this.id.length)
|
if (this.id != 0)
|
||||||
writer.writeString(1, this.id);
|
writer.writeUint32(1, this.id);
|
||||||
if (this.code.length)
|
if (this.code.length)
|
||||||
writer.writeString(2, this.code);
|
writer.writeString(2, this.code);
|
||||||
if (this.childrenId.length)
|
if (this.childrenId.length)
|
||||||
writer.writeRepeatedString(3, this.childrenId);
|
writer.writePackedUint32(3, this.childrenId);
|
||||||
if (this.physicalSectionId.length)
|
if (this.physicalSectionId != 0)
|
||||||
writer.writeString(4, this.physicalSectionId);
|
writer.writeUint32(4, this.physicalSectionId);
|
||||||
if (this.destinationCode.length)
|
if (this.destinationCode.length)
|
||||||
writer.writeString(5, this.destinationCode);
|
writer.writeString(5, this.destinationCode);
|
||||||
if (this.has_kilometer)
|
if (this.has_kilometer)
|
||||||
@ -162,16 +162,16 @@ export namespace state {
|
|||||||
break;
|
break;
|
||||||
switch (reader.getFieldNumber()) {
|
switch (reader.getFieldNumber()) {
|
||||||
case 1:
|
case 1:
|
||||||
message.id = reader.readString();
|
message.id = reader.readUint32();
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
message.code = reader.readString();
|
message.code = reader.readString();
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
pb_1.Message.addToRepeatedField(message, 3, reader.readString());
|
message.childrenId = reader.readPackedUint32();
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
message.physicalSectionId = reader.readString();
|
message.physicalSectionId = reader.readUint32();
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
message.destinationCode = reader.readString();
|
message.destinationCode = reader.readString();
|
||||||
@ -194,7 +194,7 @@ export namespace state {
|
|||||||
export class Turnout extends pb_1.Message {
|
export class Turnout extends pb_1.Message {
|
||||||
#one_of_decls: number[][] = [];
|
#one_of_decls: number[][] = [];
|
||||||
constructor(data?: any[] | {
|
constructor(data?: any[] | {
|
||||||
id?: string;
|
id?: number;
|
||||||
code?: string;
|
code?: string;
|
||||||
kilometer?: DeviceKilometer;
|
kilometer?: DeviceKilometer;
|
||||||
}) {
|
}) {
|
||||||
@ -213,9 +213,9 @@ export namespace state {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
get id() {
|
get id() {
|
||||||
return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
|
return pb_1.Message.getFieldWithDefault(this, 1, 0) as number;
|
||||||
}
|
}
|
||||||
set id(value: string) {
|
set id(value: number) {
|
||||||
pb_1.Message.setField(this, 1, value);
|
pb_1.Message.setField(this, 1, value);
|
||||||
}
|
}
|
||||||
get code() {
|
get code() {
|
||||||
@ -234,7 +234,7 @@ export namespace state {
|
|||||||
return pb_1.Message.getField(this, 3) != null;
|
return pb_1.Message.getField(this, 3) != null;
|
||||||
}
|
}
|
||||||
static fromObject(data: {
|
static fromObject(data: {
|
||||||
id?: string;
|
id?: number;
|
||||||
code?: string;
|
code?: string;
|
||||||
kilometer?: ReturnType<typeof DeviceKilometer.prototype.toObject>;
|
kilometer?: ReturnType<typeof DeviceKilometer.prototype.toObject>;
|
||||||
}): Turnout {
|
}): Turnout {
|
||||||
@ -252,7 +252,7 @@ export namespace state {
|
|||||||
}
|
}
|
||||||
toObject() {
|
toObject() {
|
||||||
const data: {
|
const data: {
|
||||||
id?: string;
|
id?: number;
|
||||||
code?: string;
|
code?: string;
|
||||||
kilometer?: ReturnType<typeof DeviceKilometer.prototype.toObject>;
|
kilometer?: ReturnType<typeof DeviceKilometer.prototype.toObject>;
|
||||||
} = {};
|
} = {};
|
||||||
@ -271,8 +271,8 @@ export namespace state {
|
|||||||
serialize(w: pb_1.BinaryWriter): void;
|
serialize(w: pb_1.BinaryWriter): void;
|
||||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||||
const writer = w || new pb_1.BinaryWriter();
|
const writer = w || new pb_1.BinaryWriter();
|
||||||
if (this.id.length)
|
if (this.id != 0)
|
||||||
writer.writeString(1, this.id);
|
writer.writeUint32(1, this.id);
|
||||||
if (this.code.length)
|
if (this.code.length)
|
||||||
writer.writeString(2, this.code);
|
writer.writeString(2, this.code);
|
||||||
if (this.has_kilometer)
|
if (this.has_kilometer)
|
||||||
@ -287,7 +287,7 @@ export namespace state {
|
|||||||
break;
|
break;
|
||||||
switch (reader.getFieldNumber()) {
|
switch (reader.getFieldNumber()) {
|
||||||
case 1:
|
case 1:
|
||||||
message.id = reader.readString();
|
message.id = reader.readUint32();
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
message.code = reader.readString();
|
message.code = reader.readString();
|
||||||
|
@ -3252,6 +3252,7 @@ export namespace graphicData {
|
|||||||
code?: string;
|
code?: string;
|
||||||
mirror?: boolean;
|
mirror?: boolean;
|
||||||
kilometerSystem?: KilometerSystem;
|
kilometerSystem?: KilometerSystem;
|
||||||
|
refDevice?: RelatedRef;
|
||||||
}) {
|
}) {
|
||||||
super();
|
super();
|
||||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||||
@ -3268,6 +3269,9 @@ export namespace graphicData {
|
|||||||
if ("kilometerSystem" in data && data.kilometerSystem != undefined) {
|
if ("kilometerSystem" in data && data.kilometerSystem != undefined) {
|
||||||
this.kilometerSystem = data.kilometerSystem;
|
this.kilometerSystem = data.kilometerSystem;
|
||||||
}
|
}
|
||||||
|
if ("refDevice" in data && data.refDevice != undefined) {
|
||||||
|
this.refDevice = data.refDevice;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
get common() {
|
get common() {
|
||||||
@ -3300,11 +3304,21 @@ export namespace graphicData {
|
|||||||
get has_kilometerSystem() {
|
get has_kilometerSystem() {
|
||||||
return pb_1.Message.getField(this, 6) != null;
|
return pb_1.Message.getField(this, 6) != null;
|
||||||
}
|
}
|
||||||
|
get refDevice() {
|
||||||
|
return pb_1.Message.getWrapperField(this, RelatedRef, 7) as RelatedRef;
|
||||||
|
}
|
||||||
|
set refDevice(value: RelatedRef) {
|
||||||
|
pb_1.Message.setWrapperField(this, 7, value);
|
||||||
|
}
|
||||||
|
get has_refDevice() {
|
||||||
|
return pb_1.Message.getField(this, 7) != null;
|
||||||
|
}
|
||||||
static fromObject(data: {
|
static fromObject(data: {
|
||||||
common?: ReturnType<typeof CommonInfo.prototype.toObject>;
|
common?: ReturnType<typeof CommonInfo.prototype.toObject>;
|
||||||
code?: string;
|
code?: string;
|
||||||
mirror?: boolean;
|
mirror?: boolean;
|
||||||
kilometerSystem?: ReturnType<typeof KilometerSystem.prototype.toObject>;
|
kilometerSystem?: ReturnType<typeof KilometerSystem.prototype.toObject>;
|
||||||
|
refDevice?: ReturnType<typeof RelatedRef.prototype.toObject>;
|
||||||
}): Signal {
|
}): Signal {
|
||||||
const message = new Signal({});
|
const message = new Signal({});
|
||||||
if (data.common != null) {
|
if (data.common != null) {
|
||||||
@ -3319,6 +3333,9 @@ export namespace graphicData {
|
|||||||
if (data.kilometerSystem != null) {
|
if (data.kilometerSystem != null) {
|
||||||
message.kilometerSystem = KilometerSystem.fromObject(data.kilometerSystem);
|
message.kilometerSystem = KilometerSystem.fromObject(data.kilometerSystem);
|
||||||
}
|
}
|
||||||
|
if (data.refDevice != null) {
|
||||||
|
message.refDevice = RelatedRef.fromObject(data.refDevice);
|
||||||
|
}
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
toObject() {
|
toObject() {
|
||||||
@ -3327,6 +3344,7 @@ export namespace graphicData {
|
|||||||
code?: string;
|
code?: string;
|
||||||
mirror?: boolean;
|
mirror?: boolean;
|
||||||
kilometerSystem?: ReturnType<typeof KilometerSystem.prototype.toObject>;
|
kilometerSystem?: ReturnType<typeof KilometerSystem.prototype.toObject>;
|
||||||
|
refDevice?: ReturnType<typeof RelatedRef.prototype.toObject>;
|
||||||
} = {};
|
} = {};
|
||||||
if (this.common != null) {
|
if (this.common != null) {
|
||||||
data.common = this.common.toObject();
|
data.common = this.common.toObject();
|
||||||
@ -3340,6 +3358,9 @@ export namespace graphicData {
|
|||||||
if (this.kilometerSystem != null) {
|
if (this.kilometerSystem != null) {
|
||||||
data.kilometerSystem = this.kilometerSystem.toObject();
|
data.kilometerSystem = this.kilometerSystem.toObject();
|
||||||
}
|
}
|
||||||
|
if (this.refDevice != null) {
|
||||||
|
data.refDevice = this.refDevice.toObject();
|
||||||
|
}
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
serialize(): Uint8Array;
|
serialize(): Uint8Array;
|
||||||
@ -3354,6 +3375,8 @@ export namespace graphicData {
|
|||||||
writer.writeBool(3, this.mirror);
|
writer.writeBool(3, this.mirror);
|
||||||
if (this.has_kilometerSystem)
|
if (this.has_kilometerSystem)
|
||||||
writer.writeMessage(6, this.kilometerSystem, () => this.kilometerSystem.serialize(writer));
|
writer.writeMessage(6, this.kilometerSystem, () => this.kilometerSystem.serialize(writer));
|
||||||
|
if (this.has_refDevice)
|
||||||
|
writer.writeMessage(7, this.refDevice, () => this.refDevice.serialize(writer));
|
||||||
if (!w)
|
if (!w)
|
||||||
return writer.getResultBuffer();
|
return writer.getResultBuffer();
|
||||||
}
|
}
|
||||||
@ -3375,6 +3398,9 @@ export namespace graphicData {
|
|||||||
case 6:
|
case 6:
|
||||||
reader.readMessage(message.kilometerSystem, () => message.kilometerSystem = KilometerSystem.deserialize(reader));
|
reader.readMessage(message.kilometerSystem, () => message.kilometerSystem = KilometerSystem.deserialize(reader));
|
||||||
break;
|
break;
|
||||||
|
case 7:
|
||||||
|
reader.readMessage(message.refDevice, () => message.refDevice = RelatedRef.deserialize(reader));
|
||||||
|
break;
|
||||||
default: reader.skipField();
|
default: reader.skipField();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
188
src/protos/system_warn_message.ts
Normal file
188
src/protos/system_warn_message.ts
Normal file
@ -0,0 +1,188 @@
|
|||||||
|
/**
|
||||||
|
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||||
|
* compiler version: 4.23.1
|
||||||
|
* source: system_warn_message.proto
|
||||||
|
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||||
|
import * as pb_1 from "google-protobuf";
|
||||||
|
export namespace state {
|
||||||
|
export class WarnLineMessage extends pb_1.Message {
|
||||||
|
#one_of_decls: number[][] = [];
|
||||||
|
constructor(data?: any[] | {
|
||||||
|
msgs?: WarnMessage[];
|
||||||
|
}) {
|
||||||
|
super();
|
||||||
|
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], this.#one_of_decls);
|
||||||
|
if (!Array.isArray(data) && typeof data == "object") {
|
||||||
|
if ("msgs" in data && data.msgs != undefined) {
|
||||||
|
this.msgs = data.msgs;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
get msgs() {
|
||||||
|
return pb_1.Message.getRepeatedWrapperField(this, WarnMessage, 1) as WarnMessage[];
|
||||||
|
}
|
||||||
|
set msgs(value: WarnMessage[]) {
|
||||||
|
pb_1.Message.setRepeatedWrapperField(this, 1, value);
|
||||||
|
}
|
||||||
|
static fromObject(data: {
|
||||||
|
msgs?: ReturnType<typeof WarnMessage.prototype.toObject>[];
|
||||||
|
}): WarnLineMessage {
|
||||||
|
const message = new WarnLineMessage({});
|
||||||
|
if (data.msgs != null) {
|
||||||
|
message.msgs = data.msgs.map(item => WarnMessage.fromObject(item));
|
||||||
|
}
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
toObject() {
|
||||||
|
const data: {
|
||||||
|
msgs?: ReturnType<typeof WarnMessage.prototype.toObject>[];
|
||||||
|
} = {};
|
||||||
|
if (this.msgs != null) {
|
||||||
|
data.msgs = this.msgs.map((item: WarnMessage) => 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.msgs.length)
|
||||||
|
writer.writeRepeatedMessage(1, this.msgs, (item: WarnMessage) => item.serialize(writer));
|
||||||
|
if (!w)
|
||||||
|
return writer.getResultBuffer();
|
||||||
|
}
|
||||||
|
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): WarnLineMessage {
|
||||||
|
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new WarnLineMessage();
|
||||||
|
while (reader.nextField()) {
|
||||||
|
if (reader.isEndGroup())
|
||||||
|
break;
|
||||||
|
switch (reader.getFieldNumber()) {
|
||||||
|
case 1:
|
||||||
|
reader.readMessage(message.msgs, () => pb_1.Message.addToRepeatedWrapperField(message, 1, WarnMessage.deserialize(reader), WarnMessage));
|
||||||
|
break;
|
||||||
|
default: reader.skipField();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
serializeBinary(): Uint8Array {
|
||||||
|
return this.serialize();
|
||||||
|
}
|
||||||
|
static deserializeBinary(bytes: Uint8Array): WarnLineMessage {
|
||||||
|
return WarnLineMessage.deserialize(bytes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
export class WarnMessage extends pb_1.Message {
|
||||||
|
#one_of_decls: number[][] = [];
|
||||||
|
constructor(data?: any[] | {
|
||||||
|
lineId?: number;
|
||||||
|
occRealConned?: boolean;
|
||||||
|
occUnrealConned?: 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 ("lineId" in data && data.lineId != undefined) {
|
||||||
|
this.lineId = data.lineId;
|
||||||
|
}
|
||||||
|
if ("occRealConned" in data && data.occRealConned != undefined) {
|
||||||
|
this.occRealConned = data.occRealConned;
|
||||||
|
}
|
||||||
|
if ("occUnrealConned" in data && data.occUnrealConned != undefined) {
|
||||||
|
this.occUnrealConned = data.occUnrealConned;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
get lineId() {
|
||||||
|
return pb_1.Message.getFieldWithDefault(this, 1, 0) as number;
|
||||||
|
}
|
||||||
|
set lineId(value: number) {
|
||||||
|
pb_1.Message.setField(this, 1, value);
|
||||||
|
}
|
||||||
|
get occRealConned() {
|
||||||
|
return pb_1.Message.getFieldWithDefault(this, 2, false) as boolean;
|
||||||
|
}
|
||||||
|
set occRealConned(value: boolean) {
|
||||||
|
pb_1.Message.setField(this, 2, value);
|
||||||
|
}
|
||||||
|
get occUnrealConned() {
|
||||||
|
return pb_1.Message.getFieldWithDefault(this, 3, false) as boolean;
|
||||||
|
}
|
||||||
|
set occUnrealConned(value: boolean) {
|
||||||
|
pb_1.Message.setField(this, 3, value);
|
||||||
|
}
|
||||||
|
static fromObject(data: {
|
||||||
|
lineId?: number;
|
||||||
|
occRealConned?: boolean;
|
||||||
|
occUnrealConned?: boolean;
|
||||||
|
}): WarnMessage {
|
||||||
|
const message = new WarnMessage({});
|
||||||
|
if (data.lineId != null) {
|
||||||
|
message.lineId = data.lineId;
|
||||||
|
}
|
||||||
|
if (data.occRealConned != null) {
|
||||||
|
message.occRealConned = data.occRealConned;
|
||||||
|
}
|
||||||
|
if (data.occUnrealConned != null) {
|
||||||
|
message.occUnrealConned = data.occUnrealConned;
|
||||||
|
}
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
toObject() {
|
||||||
|
const data: {
|
||||||
|
lineId?: number;
|
||||||
|
occRealConned?: boolean;
|
||||||
|
occUnrealConned?: boolean;
|
||||||
|
} = {};
|
||||||
|
if (this.lineId != null) {
|
||||||
|
data.lineId = this.lineId;
|
||||||
|
}
|
||||||
|
if (this.occRealConned != null) {
|
||||||
|
data.occRealConned = this.occRealConned;
|
||||||
|
}
|
||||||
|
if (this.occUnrealConned != null) {
|
||||||
|
data.occUnrealConned = this.occUnrealConned;
|
||||||
|
}
|
||||||
|
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.occRealConned != false)
|
||||||
|
writer.writeBool(2, this.occRealConned);
|
||||||
|
if (this.occUnrealConned != false)
|
||||||
|
writer.writeBool(3, this.occUnrealConned);
|
||||||
|
if (!w)
|
||||||
|
return writer.getResultBuffer();
|
||||||
|
}
|
||||||
|
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): WarnMessage {
|
||||||
|
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new WarnMessage();
|
||||||
|
while (reader.nextField()) {
|
||||||
|
if (reader.isEndGroup())
|
||||||
|
break;
|
||||||
|
switch (reader.getFieldNumber()) {
|
||||||
|
case 1:
|
||||||
|
message.lineId = reader.readInt32();
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
message.occRealConned = reader.readBool();
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
message.occUnrealConned = reader.readBool();
|
||||||
|
break;
|
||||||
|
default: reader.skipField();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
serializeBinary(): Uint8Array {
|
||||||
|
return this.serialize();
|
||||||
|
}
|
||||||
|
static deserializeBinary(bytes: Uint8Array): WarnMessage {
|
||||||
|
return WarnMessage.deserialize(bytes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1 +1 @@
|
|||||||
Subproject commit fa88eaa4292a4818d28628d66227d38765eacf84
|
Subproject commit 509c8f3f91257e1c489c2bb2435fa66f0fc29cab
|
Loading…
Reference in New Issue
Block a user