proto文件同步

This commit is contained in:
fan 2023-08-25 09:02:12 +08:00
parent 93a9915cdb
commit f58b744aac
3 changed files with 630 additions and 1 deletions

@ -1 +1 @@
Subproject commit 5d09a37666f786d9229ea314ac9f773b8dc1bcbd
Subproject commit 45f19cff37b1e5797d160617642d140a116e2689

View File

@ -560,6 +560,7 @@ export namespace state {
devicePort?: string;
pointTo?: boolean;
runDirection?: boolean;
headDirection?: boolean;
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [7], this.#one_of_decls);
@ -651,6 +652,9 @@ export namespace state {
if ("runDirection" in data && data.runDirection != undefined) {
this.runDirection = data.runDirection;
}
if ("headDirection" in data && data.headDirection != undefined) {
this.headDirection = data.headDirection;
}
}
}
get id() {
@ -827,6 +831,12 @@ export namespace state {
set runDirection(value: boolean) {
pb_1.Message.setField(this, 29, value);
}
get headDirection() {
return pb_1.Message.getFieldWithDefault(this, 30, false) as boolean;
}
set headDirection(value: boolean) {
pb_1.Message.setField(this, 30, value);
}
static fromObject(data: {
id?: string;
up?: boolean;
@ -857,6 +867,7 @@ export namespace state {
devicePort?: string;
pointTo?: boolean;
runDirection?: boolean;
headDirection?: boolean;
}): TrainState {
const message = new TrainState({});
if (data.id != null) {
@ -946,6 +957,9 @@ export namespace state {
if (data.runDirection != null) {
message.runDirection = data.runDirection;
}
if (data.headDirection != null) {
message.headDirection = data.headDirection;
}
return message;
}
toObject() {
@ -979,6 +993,7 @@ export namespace state {
devicePort?: string;
pointTo?: boolean;
runDirection?: boolean;
headDirection?: boolean;
} = {};
if (this.id != null) {
data.id = this.id;
@ -1067,6 +1082,9 @@ export namespace state {
if (this.runDirection != null) {
data.runDirection = this.runDirection;
}
if (this.headDirection != null) {
data.headDirection = this.headDirection;
}
return data;
}
serialize(): Uint8Array;
@ -1131,6 +1149,8 @@ export namespace state {
writer.writeBool(28, this.pointTo);
if (this.runDirection != false)
writer.writeBool(29, this.runDirection);
if (this.headDirection != false)
writer.writeBool(30, this.headDirection);
if (!w)
return writer.getResultBuffer();
}
@ -1227,6 +1247,9 @@ export namespace state {
case 29:
message.runDirection = reader.readBool();
break;
case 30:
message.headDirection = reader.readBool();
break;
default: reader.skipField();
}
}
@ -1239,6 +1262,602 @@ export namespace state {
return TrainState.deserialize(bytes);
}
}
export class TrainVobcState extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
lifeSignal?: number;
tc1Active?: boolean;
tc2Active?: boolean;
directionForward?: boolean;
directionBackward?: boolean;
tractionStatus?: boolean;
brakingStatus?: boolean;
emergencyBrakingStatus?: boolean;
turnbackStatus?: boolean;
jumpStatus?: boolean;
ato?: boolean;
fam?: boolean;
cam?: boolean;
tractionSafetyCircuit?: boolean;
parkingBrakeStatus?: boolean;
maintainBrakeStatus?: boolean;
tractionForce?: number;
brakeForce?: number;
trainLoad?: number;
leftDoorOpenCommand?: boolean;
rightDoorOpenCommand?: boolean;
leftDoorCloseCommand?: boolean;
rightDoorCloseCommand?: boolean;
allDoorClose?: 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 ("lifeSignal" in data && data.lifeSignal != undefined) {
this.lifeSignal = data.lifeSignal;
}
if ("tc1Active" in data && data.tc1Active != undefined) {
this.tc1Active = data.tc1Active;
}
if ("tc2Active" in data && data.tc2Active != undefined) {
this.tc2Active = data.tc2Active;
}
if ("directionForward" in data && data.directionForward != undefined) {
this.directionForward = data.directionForward;
}
if ("directionBackward" in data && data.directionBackward != undefined) {
this.directionBackward = data.directionBackward;
}
if ("tractionStatus" in data && data.tractionStatus != undefined) {
this.tractionStatus = data.tractionStatus;
}
if ("brakingStatus" in data && data.brakingStatus != undefined) {
this.brakingStatus = data.brakingStatus;
}
if ("emergencyBrakingStatus" in data && data.emergencyBrakingStatus != undefined) {
this.emergencyBrakingStatus = data.emergencyBrakingStatus;
}
if ("turnbackStatus" in data && data.turnbackStatus != undefined) {
this.turnbackStatus = data.turnbackStatus;
}
if ("jumpStatus" in data && data.jumpStatus != undefined) {
this.jumpStatus = data.jumpStatus;
}
if ("ato" in data && data.ato != undefined) {
this.ato = data.ato;
}
if ("fam" in data && data.fam != undefined) {
this.fam = data.fam;
}
if ("cam" in data && data.cam != undefined) {
this.cam = data.cam;
}
if ("tractionSafetyCircuit" in data && data.tractionSafetyCircuit != undefined) {
this.tractionSafetyCircuit = data.tractionSafetyCircuit;
}
if ("parkingBrakeStatus" in data && data.parkingBrakeStatus != undefined) {
this.parkingBrakeStatus = data.parkingBrakeStatus;
}
if ("maintainBrakeStatus" in data && data.maintainBrakeStatus != undefined) {
this.maintainBrakeStatus = data.maintainBrakeStatus;
}
if ("tractionForce" in data && data.tractionForce != undefined) {
this.tractionForce = data.tractionForce;
}
if ("brakeForce" in data && data.brakeForce != undefined) {
this.brakeForce = data.brakeForce;
}
if ("trainLoad" in data && data.trainLoad != undefined) {
this.trainLoad = data.trainLoad;
}
if ("leftDoorOpenCommand" in data && data.leftDoorOpenCommand != undefined) {
this.leftDoorOpenCommand = data.leftDoorOpenCommand;
}
if ("rightDoorOpenCommand" in data && data.rightDoorOpenCommand != undefined) {
this.rightDoorOpenCommand = data.rightDoorOpenCommand;
}
if ("leftDoorCloseCommand" in data && data.leftDoorCloseCommand != undefined) {
this.leftDoorCloseCommand = data.leftDoorCloseCommand;
}
if ("rightDoorCloseCommand" in data && data.rightDoorCloseCommand != undefined) {
this.rightDoorCloseCommand = data.rightDoorCloseCommand;
}
if ("allDoorClose" in data && data.allDoorClose != undefined) {
this.allDoorClose = data.allDoorClose;
}
}
}
get lifeSignal() {
return pb_1.Message.getFieldWithDefault(this, 1, 0) as number;
}
set lifeSignal(value: number) {
pb_1.Message.setField(this, 1, value);
}
get tc1Active() {
return pb_1.Message.getFieldWithDefault(this, 2, false) as boolean;
}
set tc1Active(value: boolean) {
pb_1.Message.setField(this, 2, value);
}
get tc2Active() {
return pb_1.Message.getFieldWithDefault(this, 3, false) as boolean;
}
set tc2Active(value: boolean) {
pb_1.Message.setField(this, 3, value);
}
get directionForward() {
return pb_1.Message.getFieldWithDefault(this, 4, false) as boolean;
}
set directionForward(value: boolean) {
pb_1.Message.setField(this, 4, value);
}
get directionBackward() {
return pb_1.Message.getFieldWithDefault(this, 5, false) as boolean;
}
set directionBackward(value: boolean) {
pb_1.Message.setField(this, 5, value);
}
get tractionStatus() {
return pb_1.Message.getFieldWithDefault(this, 6, false) as boolean;
}
set tractionStatus(value: boolean) {
pb_1.Message.setField(this, 6, value);
}
get brakingStatus() {
return pb_1.Message.getFieldWithDefault(this, 7, false) as boolean;
}
set brakingStatus(value: boolean) {
pb_1.Message.setField(this, 7, value);
}
get emergencyBrakingStatus() {
return pb_1.Message.getFieldWithDefault(this, 8, false) as boolean;
}
set emergencyBrakingStatus(value: boolean) {
pb_1.Message.setField(this, 8, value);
}
get turnbackStatus() {
return pb_1.Message.getFieldWithDefault(this, 9, false) as boolean;
}
set turnbackStatus(value: boolean) {
pb_1.Message.setField(this, 9, value);
}
get jumpStatus() {
return pb_1.Message.getFieldWithDefault(this, 10, false) as boolean;
}
set jumpStatus(value: boolean) {
pb_1.Message.setField(this, 10, value);
}
get ato() {
return pb_1.Message.getFieldWithDefault(this, 11, false) as boolean;
}
set ato(value: boolean) {
pb_1.Message.setField(this, 11, value);
}
get fam() {
return pb_1.Message.getFieldWithDefault(this, 12, false) as boolean;
}
set fam(value: boolean) {
pb_1.Message.setField(this, 12, value);
}
get cam() {
return pb_1.Message.getFieldWithDefault(this, 13, false) as boolean;
}
set cam(value: boolean) {
pb_1.Message.setField(this, 13, value);
}
get tractionSafetyCircuit() {
return pb_1.Message.getFieldWithDefault(this, 14, false) as boolean;
}
set tractionSafetyCircuit(value: boolean) {
pb_1.Message.setField(this, 14, value);
}
get parkingBrakeStatus() {
return pb_1.Message.getFieldWithDefault(this, 15, false) as boolean;
}
set parkingBrakeStatus(value: boolean) {
pb_1.Message.setField(this, 15, value);
}
get maintainBrakeStatus() {
return pb_1.Message.getFieldWithDefault(this, 16, false) as boolean;
}
set maintainBrakeStatus(value: boolean) {
pb_1.Message.setField(this, 16, value);
}
get tractionForce() {
return pb_1.Message.getFieldWithDefault(this, 17, 0) as number;
}
set tractionForce(value: number) {
pb_1.Message.setField(this, 17, value);
}
get brakeForce() {
return pb_1.Message.getFieldWithDefault(this, 18, 0) as number;
}
set brakeForce(value: number) {
pb_1.Message.setField(this, 18, value);
}
get trainLoad() {
return pb_1.Message.getFieldWithDefault(this, 19, 0) as number;
}
set trainLoad(value: number) {
pb_1.Message.setField(this, 19, value);
}
get leftDoorOpenCommand() {
return pb_1.Message.getFieldWithDefault(this, 20, false) as boolean;
}
set leftDoorOpenCommand(value: boolean) {
pb_1.Message.setField(this, 20, value);
}
get rightDoorOpenCommand() {
return pb_1.Message.getFieldWithDefault(this, 21, false) as boolean;
}
set rightDoorOpenCommand(value: boolean) {
pb_1.Message.setField(this, 21, value);
}
get leftDoorCloseCommand() {
return pb_1.Message.getFieldWithDefault(this, 22, false) as boolean;
}
set leftDoorCloseCommand(value: boolean) {
pb_1.Message.setField(this, 22, value);
}
get rightDoorCloseCommand() {
return pb_1.Message.getFieldWithDefault(this, 23, false) as boolean;
}
set rightDoorCloseCommand(value: boolean) {
pb_1.Message.setField(this, 23, value);
}
get allDoorClose() {
return pb_1.Message.getFieldWithDefault(this, 24, false) as boolean;
}
set allDoorClose(value: boolean) {
pb_1.Message.setField(this, 24, value);
}
static fromObject(data: {
lifeSignal?: number;
tc1Active?: boolean;
tc2Active?: boolean;
directionForward?: boolean;
directionBackward?: boolean;
tractionStatus?: boolean;
brakingStatus?: boolean;
emergencyBrakingStatus?: boolean;
turnbackStatus?: boolean;
jumpStatus?: boolean;
ato?: boolean;
fam?: boolean;
cam?: boolean;
tractionSafetyCircuit?: boolean;
parkingBrakeStatus?: boolean;
maintainBrakeStatus?: boolean;
tractionForce?: number;
brakeForce?: number;
trainLoad?: number;
leftDoorOpenCommand?: boolean;
rightDoorOpenCommand?: boolean;
leftDoorCloseCommand?: boolean;
rightDoorCloseCommand?: boolean;
allDoorClose?: boolean;
}): TrainVobcState {
const message = new TrainVobcState({});
if (data.lifeSignal != null) {
message.lifeSignal = data.lifeSignal;
}
if (data.tc1Active != null) {
message.tc1Active = data.tc1Active;
}
if (data.tc2Active != null) {
message.tc2Active = data.tc2Active;
}
if (data.directionForward != null) {
message.directionForward = data.directionForward;
}
if (data.directionBackward != null) {
message.directionBackward = data.directionBackward;
}
if (data.tractionStatus != null) {
message.tractionStatus = data.tractionStatus;
}
if (data.brakingStatus != null) {
message.brakingStatus = data.brakingStatus;
}
if (data.emergencyBrakingStatus != null) {
message.emergencyBrakingStatus = data.emergencyBrakingStatus;
}
if (data.turnbackStatus != null) {
message.turnbackStatus = data.turnbackStatus;
}
if (data.jumpStatus != null) {
message.jumpStatus = data.jumpStatus;
}
if (data.ato != null) {
message.ato = data.ato;
}
if (data.fam != null) {
message.fam = data.fam;
}
if (data.cam != null) {
message.cam = data.cam;
}
if (data.tractionSafetyCircuit != null) {
message.tractionSafetyCircuit = data.tractionSafetyCircuit;
}
if (data.parkingBrakeStatus != null) {
message.parkingBrakeStatus = data.parkingBrakeStatus;
}
if (data.maintainBrakeStatus != null) {
message.maintainBrakeStatus = data.maintainBrakeStatus;
}
if (data.tractionForce != null) {
message.tractionForce = data.tractionForce;
}
if (data.brakeForce != null) {
message.brakeForce = data.brakeForce;
}
if (data.trainLoad != null) {
message.trainLoad = data.trainLoad;
}
if (data.leftDoorOpenCommand != null) {
message.leftDoorOpenCommand = data.leftDoorOpenCommand;
}
if (data.rightDoorOpenCommand != null) {
message.rightDoorOpenCommand = data.rightDoorOpenCommand;
}
if (data.leftDoorCloseCommand != null) {
message.leftDoorCloseCommand = data.leftDoorCloseCommand;
}
if (data.rightDoorCloseCommand != null) {
message.rightDoorCloseCommand = data.rightDoorCloseCommand;
}
if (data.allDoorClose != null) {
message.allDoorClose = data.allDoorClose;
}
return message;
}
toObject() {
const data: {
lifeSignal?: number;
tc1Active?: boolean;
tc2Active?: boolean;
directionForward?: boolean;
directionBackward?: boolean;
tractionStatus?: boolean;
brakingStatus?: boolean;
emergencyBrakingStatus?: boolean;
turnbackStatus?: boolean;
jumpStatus?: boolean;
ato?: boolean;
fam?: boolean;
cam?: boolean;
tractionSafetyCircuit?: boolean;
parkingBrakeStatus?: boolean;
maintainBrakeStatus?: boolean;
tractionForce?: number;
brakeForce?: number;
trainLoad?: number;
leftDoorOpenCommand?: boolean;
rightDoorOpenCommand?: boolean;
leftDoorCloseCommand?: boolean;
rightDoorCloseCommand?: boolean;
allDoorClose?: boolean;
} = {};
if (this.lifeSignal != null) {
data.lifeSignal = this.lifeSignal;
}
if (this.tc1Active != null) {
data.tc1Active = this.tc1Active;
}
if (this.tc2Active != null) {
data.tc2Active = this.tc2Active;
}
if (this.directionForward != null) {
data.directionForward = this.directionForward;
}
if (this.directionBackward != null) {
data.directionBackward = this.directionBackward;
}
if (this.tractionStatus != null) {
data.tractionStatus = this.tractionStatus;
}
if (this.brakingStatus != null) {
data.brakingStatus = this.brakingStatus;
}
if (this.emergencyBrakingStatus != null) {
data.emergencyBrakingStatus = this.emergencyBrakingStatus;
}
if (this.turnbackStatus != null) {
data.turnbackStatus = this.turnbackStatus;
}
if (this.jumpStatus != null) {
data.jumpStatus = this.jumpStatus;
}
if (this.ato != null) {
data.ato = this.ato;
}
if (this.fam != null) {
data.fam = this.fam;
}
if (this.cam != null) {
data.cam = this.cam;
}
if (this.tractionSafetyCircuit != null) {
data.tractionSafetyCircuit = this.tractionSafetyCircuit;
}
if (this.parkingBrakeStatus != null) {
data.parkingBrakeStatus = this.parkingBrakeStatus;
}
if (this.maintainBrakeStatus != null) {
data.maintainBrakeStatus = this.maintainBrakeStatus;
}
if (this.tractionForce != null) {
data.tractionForce = this.tractionForce;
}
if (this.brakeForce != null) {
data.brakeForce = this.brakeForce;
}
if (this.trainLoad != null) {
data.trainLoad = this.trainLoad;
}
if (this.leftDoorOpenCommand != null) {
data.leftDoorOpenCommand = this.leftDoorOpenCommand;
}
if (this.rightDoorOpenCommand != null) {
data.rightDoorOpenCommand = this.rightDoorOpenCommand;
}
if (this.leftDoorCloseCommand != null) {
data.leftDoorCloseCommand = this.leftDoorCloseCommand;
}
if (this.rightDoorCloseCommand != null) {
data.rightDoorCloseCommand = this.rightDoorCloseCommand;
}
if (this.allDoorClose != null) {
data.allDoorClose = this.allDoorClose;
}
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.lifeSignal != 0)
writer.writeInt32(1, this.lifeSignal);
if (this.tc1Active != false)
writer.writeBool(2, this.tc1Active);
if (this.tc2Active != false)
writer.writeBool(3, this.tc2Active);
if (this.directionForward != false)
writer.writeBool(4, this.directionForward);
if (this.directionBackward != false)
writer.writeBool(5, this.directionBackward);
if (this.tractionStatus != false)
writer.writeBool(6, this.tractionStatus);
if (this.brakingStatus != false)
writer.writeBool(7, this.brakingStatus);
if (this.emergencyBrakingStatus != false)
writer.writeBool(8, this.emergencyBrakingStatus);
if (this.turnbackStatus != false)
writer.writeBool(9, this.turnbackStatus);
if (this.jumpStatus != false)
writer.writeBool(10, this.jumpStatus);
if (this.ato != false)
writer.writeBool(11, this.ato);
if (this.fam != false)
writer.writeBool(12, this.fam);
if (this.cam != false)
writer.writeBool(13, this.cam);
if (this.tractionSafetyCircuit != false)
writer.writeBool(14, this.tractionSafetyCircuit);
if (this.parkingBrakeStatus != false)
writer.writeBool(15, this.parkingBrakeStatus);
if (this.maintainBrakeStatus != false)
writer.writeBool(16, this.maintainBrakeStatus);
if (this.tractionForce != 0)
writer.writeInt64(17, this.tractionForce);
if (this.brakeForce != 0)
writer.writeInt64(18, this.brakeForce);
if (this.trainLoad != 0)
writer.writeInt64(19, this.trainLoad);
if (this.leftDoorOpenCommand != false)
writer.writeBool(20, this.leftDoorOpenCommand);
if (this.rightDoorOpenCommand != false)
writer.writeBool(21, this.rightDoorOpenCommand);
if (this.leftDoorCloseCommand != false)
writer.writeBool(22, this.leftDoorCloseCommand);
if (this.rightDoorCloseCommand != false)
writer.writeBool(23, this.rightDoorCloseCommand);
if (this.allDoorClose != false)
writer.writeBool(24, this.allDoorClose);
if (!w)
return writer.getResultBuffer();
}
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): TrainVobcState {
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new TrainVobcState();
while (reader.nextField()) {
if (reader.isEndGroup())
break;
switch (reader.getFieldNumber()) {
case 1:
message.lifeSignal = reader.readInt32();
break;
case 2:
message.tc1Active = reader.readBool();
break;
case 3:
message.tc2Active = reader.readBool();
break;
case 4:
message.directionForward = reader.readBool();
break;
case 5:
message.directionBackward = reader.readBool();
break;
case 6:
message.tractionStatus = reader.readBool();
break;
case 7:
message.brakingStatus = reader.readBool();
break;
case 8:
message.emergencyBrakingStatus = reader.readBool();
break;
case 9:
message.turnbackStatus = reader.readBool();
break;
case 10:
message.jumpStatus = reader.readBool();
break;
case 11:
message.ato = reader.readBool();
break;
case 12:
message.fam = reader.readBool();
break;
case 13:
message.cam = reader.readBool();
break;
case 14:
message.tractionSafetyCircuit = reader.readBool();
break;
case 15:
message.parkingBrakeStatus = reader.readBool();
break;
case 16:
message.maintainBrakeStatus = reader.readBool();
break;
case 17:
message.tractionForce = reader.readInt64();
break;
case 18:
message.brakeForce = reader.readInt64();
break;
case 19:
message.trainLoad = reader.readInt64();
break;
case 20:
message.leftDoorOpenCommand = reader.readBool();
break;
case 21:
message.rightDoorOpenCommand = reader.readBool();
break;
case 22:
message.leftDoorCloseCommand = reader.readBool();
break;
case 23:
message.rightDoorCloseCommand = reader.readBool();
break;
case 24:
message.allDoorClose = reader.readBool();
break;
default: reader.skipField();
}
}
return message;
}
serializeBinary(): Uint8Array {
return this.serialize();
}
static deserializeBinary(bytes: Uint8Array): TrainVobcState {
return TrainVobcState.deserialize(bytes);
}
}
export class VariationStatus extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {

10
src/protos/picture.ts Normal file
View File

@ -0,0 +1,10 @@
/**
* Generated by the protoc-gen-ts. DO NOT EDIT!
* compiler version: 4.23.1
* source: picture.proto
* git: https://github.com/thesayyn/protoc-gen-ts */
import * as pb_1 from "google-protobuf";
export enum PictureType {
StationLayout = 0,
Psl = 1
}