diff --git a/src/protos/device_state.ts b/src/protos/device_state.ts index ea6e47f..8a5d9df 100644 --- a/src/protos/device_state.ts +++ b/src/protos/device_state.ts @@ -1273,21 +1273,19 @@ export namespace state { tailDeviceId?: number; tailOffset?: number; tailDevicePort?: string; + btmState?: BTMState; tcc?: TrainControlState; connState?: TrainConnState; pluseCount?: SensorSpeedPulseCount; + vobcBtm?: VobcBtmState; oldLink?: string; oldLinkOffset?: number; - oldTailLink?: string; - oldTailLinkOffset?: number; - btmBaliseCacheA?: TrainBtmCache; - btmBaliseCacheB?: TrainBtmCache; + btmBaliseCache?: TrainBtmCache; TrainLoad?: number; TrainMaxSpeed?: number; TrainMaxAcc?: number; TrainMaxBrake?: number; TrainEmergencyBrake?: number; - projectCode?: string; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); @@ -1358,6 +1356,9 @@ export namespace state { if ("tailDevicePort" in data && data.tailDevicePort != undefined) { this.tailDevicePort = data.tailDevicePort; } + if ("btmState" in data && data.btmState != undefined) { + this.btmState = data.btmState; + } if ("tcc" in data && data.tcc != undefined) { this.tcc = data.tcc; } @@ -1367,23 +1368,17 @@ export namespace state { if ("pluseCount" in data && data.pluseCount != undefined) { this.pluseCount = data.pluseCount; } + if ("vobcBtm" in data && data.vobcBtm != undefined) { + this.vobcBtm = data.vobcBtm; + } if ("oldLink" in data && data.oldLink != undefined) { this.oldLink = data.oldLink; } if ("oldLinkOffset" in data && data.oldLinkOffset != undefined) { this.oldLinkOffset = data.oldLinkOffset; } - if ("oldTailLink" in data && data.oldTailLink != undefined) { - this.oldTailLink = data.oldTailLink; - } - if ("oldTailLinkOffset" in data && data.oldTailLinkOffset != undefined) { - this.oldTailLinkOffset = data.oldTailLinkOffset; - } - if ("btmBaliseCacheA" in data && data.btmBaliseCacheA != undefined) { - this.btmBaliseCacheA = data.btmBaliseCacheA; - } - if ("btmBaliseCacheB" in data && data.btmBaliseCacheB != undefined) { - this.btmBaliseCacheB = data.btmBaliseCacheB; + if ("btmBaliseCache" in data && data.btmBaliseCache != undefined) { + this.btmBaliseCache = data.btmBaliseCache; } if ("TrainLoad" in data && data.TrainLoad != undefined) { this.TrainLoad = data.TrainLoad; @@ -1400,9 +1395,6 @@ export namespace state { if ("TrainEmergencyBrake" in data && data.TrainEmergencyBrake != undefined) { this.TrainEmergencyBrake = data.TrainEmergencyBrake; } - if ("projectCode" in data && data.projectCode != undefined) { - this.projectCode = data.projectCode; - } } } get id() { @@ -1552,6 +1544,15 @@ export namespace state { set tailDevicePort(value: string) { pb_1.Message.setField(this, 22, value); } + get btmState() { + return pb_1.Message.getWrapperField(this, BTMState, 23) as BTMState; + } + set btmState(value: BTMState) { + pb_1.Message.setWrapperField(this, 23, value); + } + get has_btmState() { + return pb_1.Message.getField(this, 23) != null; + } get tcc() { return pb_1.Message.getWrapperField(this, TrainControlState, 24) as TrainControlState; } @@ -1579,6 +1580,15 @@ export namespace state { get has_pluseCount() { return pb_1.Message.getField(this, 26) != null; } + get vobcBtm() { + return pb_1.Message.getWrapperField(this, VobcBtmState, 27) as VobcBtmState; + } + set vobcBtm(value: VobcBtmState) { + pb_1.Message.setWrapperField(this, 27, value); + } + get has_vobcBtm() { + return pb_1.Message.getField(this, 27) != null; + } get oldLink() { return pb_1.Message.getFieldWithDefault(this, 28, "") as string; } @@ -1591,71 +1601,44 @@ export namespace state { set oldLinkOffset(value: number) { pb_1.Message.setField(this, 29, value); } - get oldTailLink() { - return pb_1.Message.getFieldWithDefault(this, 30, "") as string; + get btmBaliseCache() { + return pb_1.Message.getWrapperField(this, TrainBtmCache, 30) as TrainBtmCache; } - set oldTailLink(value: string) { - pb_1.Message.setField(this, 30, value); + set btmBaliseCache(value: TrainBtmCache) { + pb_1.Message.setWrapperField(this, 30, value); } - get oldTailLinkOffset() { - return pb_1.Message.getFieldWithDefault(this, 31, 0) as number; - } - set oldTailLinkOffset(value: number) { - pb_1.Message.setField(this, 31, value); - } - get btmBaliseCacheA() { - return pb_1.Message.getWrapperField(this, TrainBtmCache, 32) as TrainBtmCache; - } - set btmBaliseCacheA(value: TrainBtmCache) { - pb_1.Message.setWrapperField(this, 32, value); - } - get has_btmBaliseCacheA() { - return pb_1.Message.getField(this, 32) != null; - } - get btmBaliseCacheB() { - return pb_1.Message.getWrapperField(this, TrainBtmCache, 33) as TrainBtmCache; - } - set btmBaliseCacheB(value: TrainBtmCache) { - pb_1.Message.setWrapperField(this, 33, value); - } - get has_btmBaliseCacheB() { - return pb_1.Message.getField(this, 33) != null; + get has_btmBaliseCache() { + return pb_1.Message.getField(this, 30) != null; } get TrainLoad() { - return pb_1.Message.getFieldWithDefault(this, 34, 0) as number; + return pb_1.Message.getFieldWithDefault(this, 31, 0) as number; } set TrainLoad(value: number) { - pb_1.Message.setField(this, 34, value); + pb_1.Message.setField(this, 31, value); } get TrainMaxSpeed() { - return pb_1.Message.getFieldWithDefault(this, 35, 0) as number; + return pb_1.Message.getFieldWithDefault(this, 32, 0) as number; } set TrainMaxSpeed(value: number) { - pb_1.Message.setField(this, 35, value); + pb_1.Message.setField(this, 32, value); } get TrainMaxAcc() { - return pb_1.Message.getFieldWithDefault(this, 36, 0) as number; + return pb_1.Message.getFieldWithDefault(this, 33, 0) as number; } set TrainMaxAcc(value: number) { - pb_1.Message.setField(this, 36, value); + pb_1.Message.setField(this, 33, value); } get TrainMaxBrake() { - return pb_1.Message.getFieldWithDefault(this, 37, 0) as number; + return pb_1.Message.getFieldWithDefault(this, 34, 0) as number; } set TrainMaxBrake(value: number) { - pb_1.Message.setField(this, 37, value); + pb_1.Message.setField(this, 34, value); } get TrainEmergencyBrake() { - return pb_1.Message.getFieldWithDefault(this, 38, 0) as number; + return pb_1.Message.getFieldWithDefault(this, 35, 0) as number; } set TrainEmergencyBrake(value: number) { - pb_1.Message.setField(this, 38, value); - } - get projectCode() { - return pb_1.Message.getFieldWithDefault(this, 39, "") as string; - } - set projectCode(value: string) { - pb_1.Message.setField(this, 39, value); + pb_1.Message.setField(this, 35, value); } static fromObject(data: { id?: string; @@ -1680,21 +1663,19 @@ export namespace state { tailDeviceId?: number; tailOffset?: number; tailDevicePort?: string; + btmState?: ReturnType; tcc?: ReturnType; connState?: ReturnType; pluseCount?: ReturnType; + vobcBtm?: ReturnType; oldLink?: string; oldLinkOffset?: number; - oldTailLink?: string; - oldTailLinkOffset?: number; - btmBaliseCacheA?: ReturnType; - btmBaliseCacheB?: ReturnType; + btmBaliseCache?: ReturnType; TrainLoad?: number; TrainMaxSpeed?: number; TrainMaxAcc?: number; TrainMaxBrake?: number; TrainEmergencyBrake?: number; - projectCode?: string; }): TrainState { const message = new TrainState({}); if (data.id != null) { @@ -1763,6 +1744,9 @@ export namespace state { if (data.tailDevicePort != null) { message.tailDevicePort = data.tailDevicePort; } + if (data.btmState != null) { + message.btmState = BTMState.fromObject(data.btmState); + } if (data.tcc != null) { message.tcc = TrainControlState.fromObject(data.tcc); } @@ -1772,23 +1756,17 @@ export namespace state { if (data.pluseCount != null) { message.pluseCount = SensorSpeedPulseCount.fromObject(data.pluseCount); } + if (data.vobcBtm != null) { + message.vobcBtm = VobcBtmState.fromObject(data.vobcBtm); + } if (data.oldLink != null) { message.oldLink = data.oldLink; } if (data.oldLinkOffset != null) { message.oldLinkOffset = data.oldLinkOffset; } - if (data.oldTailLink != null) { - message.oldTailLink = data.oldTailLink; - } - if (data.oldTailLinkOffset != null) { - message.oldTailLinkOffset = data.oldTailLinkOffset; - } - if (data.btmBaliseCacheA != null) { - message.btmBaliseCacheA = TrainBtmCache.fromObject(data.btmBaliseCacheA); - } - if (data.btmBaliseCacheB != null) { - message.btmBaliseCacheB = TrainBtmCache.fromObject(data.btmBaliseCacheB); + if (data.btmBaliseCache != null) { + message.btmBaliseCache = TrainBtmCache.fromObject(data.btmBaliseCache); } if (data.TrainLoad != null) { message.TrainLoad = data.TrainLoad; @@ -1805,9 +1783,6 @@ export namespace state { if (data.TrainEmergencyBrake != null) { message.TrainEmergencyBrake = data.TrainEmergencyBrake; } - if (data.projectCode != null) { - message.projectCode = data.projectCode; - } return message; } toObject() { @@ -1834,21 +1809,19 @@ export namespace state { tailDeviceId?: number; tailOffset?: number; tailDevicePort?: string; + btmState?: ReturnType; tcc?: ReturnType; connState?: ReturnType; pluseCount?: ReturnType; + vobcBtm?: ReturnType; oldLink?: string; oldLinkOffset?: number; - oldTailLink?: string; - oldTailLinkOffset?: number; - btmBaliseCacheA?: ReturnType; - btmBaliseCacheB?: ReturnType; + btmBaliseCache?: ReturnType; TrainLoad?: number; TrainMaxSpeed?: number; TrainMaxAcc?: number; TrainMaxBrake?: number; TrainEmergencyBrake?: number; - projectCode?: string; } = {}; if (this.id != null) { data.id = this.id; @@ -1916,6 +1889,9 @@ export namespace state { if (this.tailDevicePort != null) { data.tailDevicePort = this.tailDevicePort; } + if (this.btmState != null) { + data.btmState = this.btmState.toObject(); + } if (this.tcc != null) { data.tcc = this.tcc.toObject(); } @@ -1925,23 +1901,17 @@ export namespace state { if (this.pluseCount != null) { data.pluseCount = this.pluseCount.toObject(); } + if (this.vobcBtm != null) { + data.vobcBtm = this.vobcBtm.toObject(); + } if (this.oldLink != null) { data.oldLink = this.oldLink; } if (this.oldLinkOffset != null) { data.oldLinkOffset = this.oldLinkOffset; } - if (this.oldTailLink != null) { - data.oldTailLink = this.oldTailLink; - } - if (this.oldTailLinkOffset != null) { - data.oldTailLinkOffset = this.oldTailLinkOffset; - } - if (this.btmBaliseCacheA != null) { - data.btmBaliseCacheA = this.btmBaliseCacheA.toObject(); - } - if (this.btmBaliseCacheB != null) { - data.btmBaliseCacheB = this.btmBaliseCacheB.toObject(); + if (this.btmBaliseCache != null) { + data.btmBaliseCache = this.btmBaliseCache.toObject(); } if (this.TrainLoad != null) { data.TrainLoad = this.TrainLoad; @@ -1958,9 +1928,6 @@ export namespace state { if (this.TrainEmergencyBrake != null) { data.TrainEmergencyBrake = this.TrainEmergencyBrake; } - if (this.projectCode != null) { - data.projectCode = this.projectCode; - } return data; } serialize(): Uint8Array; @@ -2011,36 +1978,32 @@ export namespace state { writer.writeInt64(21, this.tailOffset); if (this.tailDevicePort.length) writer.writeString(22, this.tailDevicePort); + if (this.has_btmState) + writer.writeMessage(23, this.btmState, () => this.btmState.serialize(writer)); if (this.has_tcc) writer.writeMessage(24, this.tcc, () => this.tcc.serialize(writer)); if (this.has_connState) writer.writeMessage(25, this.connState, () => this.connState.serialize(writer)); if (this.has_pluseCount) writer.writeMessage(26, this.pluseCount, () => this.pluseCount.serialize(writer)); + if (this.has_vobcBtm) + writer.writeMessage(27, this.vobcBtm, () => this.vobcBtm.serialize(writer)); if (this.oldLink.length) writer.writeString(28, this.oldLink); if (this.oldLinkOffset != 0) writer.writeInt64(29, this.oldLinkOffset); - if (this.oldTailLink.length) - writer.writeString(30, this.oldTailLink); - if (this.oldTailLinkOffset != 0) - writer.writeInt64(31, this.oldTailLinkOffset); - if (this.has_btmBaliseCacheA) - writer.writeMessage(32, this.btmBaliseCacheA, () => this.btmBaliseCacheA.serialize(writer)); - if (this.has_btmBaliseCacheB) - writer.writeMessage(33, this.btmBaliseCacheB, () => this.btmBaliseCacheB.serialize(writer)); + if (this.has_btmBaliseCache) + writer.writeMessage(30, this.btmBaliseCache, () => this.btmBaliseCache.serialize(writer)); if (this.TrainLoad != 0) - writer.writeInt32(34, this.TrainLoad); + writer.writeInt32(31, this.TrainLoad); if (this.TrainMaxSpeed != 0) - writer.writeFloat(35, this.TrainMaxSpeed); + writer.writeFloat(32, this.TrainMaxSpeed); if (this.TrainMaxAcc != 0) - writer.writeFloat(36, this.TrainMaxAcc); + writer.writeFloat(33, this.TrainMaxAcc); if (this.TrainMaxBrake != 0) - writer.writeFloat(37, this.TrainMaxBrake); + writer.writeFloat(34, this.TrainMaxBrake); if (this.TrainEmergencyBrake != 0) - writer.writeFloat(38, this.TrainEmergencyBrake); - if (this.projectCode.length) - writer.writeString(39, this.projectCode); + writer.writeFloat(35, this.TrainEmergencyBrake); if (!w) return writer.getResultBuffer(); } @@ -2116,6 +2079,9 @@ export namespace state { case 22: message.tailDevicePort = reader.readString(); break; + case 23: + reader.readMessage(message.btmState, () => message.btmState = BTMState.deserialize(reader)); + break; case 24: reader.readMessage(message.tcc, () => message.tcc = TrainControlState.deserialize(reader)); break; @@ -2125,6 +2091,9 @@ export namespace state { case 26: reader.readMessage(message.pluseCount, () => message.pluseCount = SensorSpeedPulseCount.deserialize(reader)); break; + case 27: + reader.readMessage(message.vobcBtm, () => message.vobcBtm = VobcBtmState.deserialize(reader)); + break; case 28: message.oldLink = reader.readString(); break; @@ -2132,35 +2101,23 @@ export namespace state { message.oldLinkOffset = reader.readInt64(); break; case 30: - message.oldTailLink = reader.readString(); + reader.readMessage(message.btmBaliseCache, () => message.btmBaliseCache = TrainBtmCache.deserialize(reader)); break; case 31: - message.oldTailLinkOffset = reader.readInt64(); - break; - case 32: - reader.readMessage(message.btmBaliseCacheA, () => message.btmBaliseCacheA = TrainBtmCache.deserialize(reader)); - break; - case 33: - reader.readMessage(message.btmBaliseCacheB, () => message.btmBaliseCacheB = TrainBtmCache.deserialize(reader)); - break; - case 34: message.TrainLoad = reader.readInt32(); break; - case 35: + case 32: message.TrainMaxSpeed = reader.readFloat(); break; - case 36: + case 33: message.TrainMaxAcc = reader.readFloat(); break; - case 37: + case 34: message.TrainMaxBrake = reader.readFloat(); break; - case 38: + case 35: message.TrainEmergencyBrake = reader.readFloat(); break; - case 39: - message.projectCode = reader.readString(); - break; default: reader.skipField(); } } @@ -2332,6 +2289,430 @@ export namespace state { return TrainBtmCache.deserialize(bytes); } } + export class VobcBtmState extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + telegramState?: VobcBtmState.TelegramState[]; + history?: Map; + }) { + 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 ("telegramState" in data && data.telegramState != undefined) { + this.telegramState = data.telegramState; + } + if ("history" in data && data.history != undefined) { + this.history = data.history; + } + } + if (!this.history) + this.history = new Map(); + } + get telegramState() { + return pb_1.Message.getRepeatedWrapperField(this, VobcBtmState.TelegramState, 1) as VobcBtmState.TelegramState[]; + } + set telegramState(value: VobcBtmState.TelegramState[]) { + pb_1.Message.setRepeatedWrapperField(this, 1, value); + } + get history() { + return pb_1.Message.getField(this, 2) as any as Map; + } + set history(value: Map) { + pb_1.Message.setField(this, 2, value as any); + } + static fromObject(data: { + telegramState?: ReturnType[]; + history?: { + [key: number]: ReturnType; + }; + }): VobcBtmState { + const message = new VobcBtmState({}); + if (data.telegramState != null) { + message.telegramState = data.telegramState.map(item => VobcBtmState.TelegramState.fromObject(item)); + } + if (typeof data.history == "object") { + message.history = new Map(Object.entries(data.history).map(([key, value]) => [Number(key), VobcBtmState.VobcBtmHistoryState.fromObject(value)])); + } + return message; + } + toObject() { + const data: { + telegramState?: ReturnType[]; + history?: { + [key: number]: ReturnType; + }; + } = {}; + if (this.telegramState != null) { + data.telegramState = this.telegramState.map((item: VobcBtmState.TelegramState) => item.toObject()); + } + if (this.history != null) { + data.history = (Object.fromEntries)((Array.from)(this.history).map(([key, value]) => [key, value.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.telegramState.length) + writer.writeRepeatedMessage(1, this.telegramState, (item: VobcBtmState.TelegramState) => item.serialize(writer)); + for (const [key, value] of this.history) { + writer.writeMessage(2, this.history, () => { + writer.writeUint32(1, key); + writer.writeMessage(2, value, () => value.serialize(writer)); + }); + } + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): VobcBtmState { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new VobcBtmState(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + reader.readMessage(message.telegramState, () => pb_1.Message.addToRepeatedWrapperField(message, 1, VobcBtmState.TelegramState.deserialize(reader), VobcBtmState.TelegramState)); + break; + case 2: + reader.readMessage(message, () => pb_1.Map.deserializeBinary(message.history as any, reader, reader.readUint32, () => { + let value; + reader.readMessage(message, () => value = VobcBtmState.VobcBtmHistoryState.deserialize(reader)); + return value; + })); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): VobcBtmState { + return VobcBtmState.deserialize(bytes); + } + } + export namespace VobcBtmState { + export class TelegramState extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + baliseId?: string; + telegram?: string; + arriveTime?: number; + leaveTime?: number; + }) { + super(); + pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); + if (!Array.isArray(data) && typeof data == "object") { + if ("baliseId" in data && data.baliseId != undefined) { + this.baliseId = data.baliseId; + } + if ("telegram" in data && data.telegram != undefined) { + this.telegram = data.telegram; + } + if ("arriveTime" in data && data.arriveTime != undefined) { + this.arriveTime = data.arriveTime; + } + if ("leaveTime" in data && data.leaveTime != undefined) { + this.leaveTime = data.leaveTime; + } + } + } + get baliseId() { + return pb_1.Message.getFieldWithDefault(this, 1, "") as string; + } + set baliseId(value: string) { + pb_1.Message.setField(this, 1, value); + } + get telegram() { + return pb_1.Message.getFieldWithDefault(this, 2, "") as string; + } + set telegram(value: string) { + pb_1.Message.setField(this, 2, value); + } + get arriveTime() { + return pb_1.Message.getFieldWithDefault(this, 5, 0) as number; + } + set arriveTime(value: number) { + pb_1.Message.setField(this, 5, value); + } + get leaveTime() { + return pb_1.Message.getFieldWithDefault(this, 6, 0) as number; + } + set leaveTime(value: number) { + pb_1.Message.setField(this, 6, value); + } + static fromObject(data: { + baliseId?: string; + telegram?: string; + arriveTime?: number; + leaveTime?: number; + }): TelegramState { + const message = new TelegramState({}); + if (data.baliseId != null) { + message.baliseId = data.baliseId; + } + if (data.telegram != null) { + message.telegram = data.telegram; + } + if (data.arriveTime != null) { + message.arriveTime = data.arriveTime; + } + if (data.leaveTime != null) { + message.leaveTime = data.leaveTime; + } + return message; + } + toObject() { + const data: { + baliseId?: string; + telegram?: string; + arriveTime?: number; + leaveTime?: number; + } = {}; + if (this.baliseId != null) { + data.baliseId = this.baliseId; + } + if (this.telegram != null) { + data.telegram = this.telegram; + } + if (this.arriveTime != null) { + data.arriveTime = this.arriveTime; + } + if (this.leaveTime != null) { + data.leaveTime = this.leaveTime; + } + 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.baliseId.length) + writer.writeString(1, this.baliseId); + if (this.telegram.length) + writer.writeString(2, this.telegram); + if (this.arriveTime != 0) + writer.writeInt64(5, this.arriveTime); + if (this.leaveTime != 0) + writer.writeInt64(6, this.leaveTime); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): TelegramState { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new TelegramState(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.baliseId = reader.readString(); + break; + case 2: + message.telegram = reader.readString(); + break; + case 5: + message.arriveTime = reader.readInt64(); + break; + case 6: + message.leaveTime = reader.readInt64(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): TelegramState { + return TelegramState.deserialize(bytes); + } + } + export class VobcBtmHistoryState extends pb_1.Message { + #one_of_decls: number[][] = []; + constructor(data?: any[] | { + sendCount?: number; + packetSendId?: number; + vobcLifeNum?: number; + sendTelegram?: string; + balisePacket?: string; + isFreePacket?: 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 ("sendCount" in data && data.sendCount != undefined) { + this.sendCount = data.sendCount; + } + if ("packetSendId" in data && data.packetSendId != undefined) { + this.packetSendId = data.packetSendId; + } + if ("vobcLifeNum" in data && data.vobcLifeNum != undefined) { + this.vobcLifeNum = data.vobcLifeNum; + } + if ("sendTelegram" in data && data.sendTelegram != undefined) { + this.sendTelegram = data.sendTelegram; + } + if ("balisePacket" in data && data.balisePacket != undefined) { + this.balisePacket = data.balisePacket; + } + if ("isFreePacket" in data && data.isFreePacket != undefined) { + this.isFreePacket = data.isFreePacket; + } + } + } + get sendCount() { + return pb_1.Message.getFieldWithDefault(this, 1, 0) as number; + } + set sendCount(value: number) { + pb_1.Message.setField(this, 1, value); + } + get packetSendId() { + return pb_1.Message.getFieldWithDefault(this, 2, 0) as number; + } + set packetSendId(value: number) { + pb_1.Message.setField(this, 2, value); + } + get vobcLifeNum() { + return pb_1.Message.getFieldWithDefault(this, 3, 0) as number; + } + set vobcLifeNum(value: number) { + pb_1.Message.setField(this, 3, value); + } + get sendTelegram() { + return pb_1.Message.getFieldWithDefault(this, 4, "") as string; + } + set sendTelegram(value: string) { + pb_1.Message.setField(this, 4, value); + } + get balisePacket() { + return pb_1.Message.getFieldWithDefault(this, 5, "") as string; + } + set balisePacket(value: string) { + pb_1.Message.setField(this, 5, value); + } + get isFreePacket() { + return pb_1.Message.getFieldWithDefault(this, 6, false) as boolean; + } + set isFreePacket(value: boolean) { + pb_1.Message.setField(this, 6, value); + } + static fromObject(data: { + sendCount?: number; + packetSendId?: number; + vobcLifeNum?: number; + sendTelegram?: string; + balisePacket?: string; + isFreePacket?: boolean; + }): VobcBtmHistoryState { + const message = new VobcBtmHistoryState({}); + if (data.sendCount != null) { + message.sendCount = data.sendCount; + } + if (data.packetSendId != null) { + message.packetSendId = data.packetSendId; + } + if (data.vobcLifeNum != null) { + message.vobcLifeNum = data.vobcLifeNum; + } + if (data.sendTelegram != null) { + message.sendTelegram = data.sendTelegram; + } + if (data.balisePacket != null) { + message.balisePacket = data.balisePacket; + } + if (data.isFreePacket != null) { + message.isFreePacket = data.isFreePacket; + } + return message; + } + toObject() { + const data: { + sendCount?: number; + packetSendId?: number; + vobcLifeNum?: number; + sendTelegram?: string; + balisePacket?: string; + isFreePacket?: boolean; + } = {}; + if (this.sendCount != null) { + data.sendCount = this.sendCount; + } + if (this.packetSendId != null) { + data.packetSendId = this.packetSendId; + } + if (this.vobcLifeNum != null) { + data.vobcLifeNum = this.vobcLifeNum; + } + if (this.sendTelegram != null) { + data.sendTelegram = this.sendTelegram; + } + if (this.balisePacket != null) { + data.balisePacket = this.balisePacket; + } + if (this.isFreePacket != null) { + data.isFreePacket = this.isFreePacket; + } + 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.sendCount != 0) + writer.writeUint32(1, this.sendCount); + if (this.packetSendId != 0) + writer.writeUint32(2, this.packetSendId); + if (this.vobcLifeNum != 0) + writer.writeUint32(3, this.vobcLifeNum); + if (this.sendTelegram.length) + writer.writeString(4, this.sendTelegram); + if (this.balisePacket.length) + writer.writeString(5, this.balisePacket); + if (this.isFreePacket != false) + writer.writeBool(6, this.isFreePacket); + if (!w) + return writer.getResultBuffer(); + } + static deserialize(bytes: Uint8Array | pb_1.BinaryReader): VobcBtmHistoryState { + const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new VobcBtmHistoryState(); + while (reader.nextField()) { + if (reader.isEndGroup()) + break; + switch (reader.getFieldNumber()) { + case 1: + message.sendCount = reader.readUint32(); + break; + case 2: + message.packetSendId = reader.readUint32(); + break; + case 3: + message.vobcLifeNum = reader.readUint32(); + break; + case 4: + message.sendTelegram = reader.readString(); + break; + case 5: + message.balisePacket = reader.readString(); + break; + case 6: + message.isFreePacket = reader.readBool(); + break; + default: reader.skipField(); + } + } + return message; + } + serializeBinary(): Uint8Array { + return this.serialize(); + } + static deserializeBinary(bytes: Uint8Array): VobcBtmHistoryState { + return VobcBtmHistoryState.deserialize(bytes); + } + } + } export class SensorSpeedPulseCount extends pb_1.Message { #one_of_decls: number[][] = []; constructor(data?: any[] | { @@ -3125,7 +3506,6 @@ export namespace state { atoCloseRightDoor?: boolean; lightAtoSend?: boolean; atoStepLevel?: TrainVobcState.AtoStepLevel; - vobcBtmInfo?: TrainVobcState.VobcBtmInfo; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); @@ -3373,9 +3753,6 @@ export namespace state { if ("atoStepLevel" in data && data.atoStepLevel != undefined) { this.atoStepLevel = data.atoStepLevel; } - if ("vobcBtmInfo" in data && data.vobcBtmInfo != undefined) { - this.vobcBtmInfo = data.vobcBtmInfo; - } } } get lifeSignal() { @@ -3864,15 +4241,6 @@ export namespace state { set atoStepLevel(value: TrainVobcState.AtoStepLevel) { pb_1.Message.setField(this, 85, value); } - get vobcBtmInfo() { - return pb_1.Message.getWrapperField(this, TrainVobcState.VobcBtmInfo, 86) as TrainVobcState.VobcBtmInfo; - } - set vobcBtmInfo(value: TrainVobcState.VobcBtmInfo) { - pb_1.Message.setWrapperField(this, 86, value); - } - get has_vobcBtmInfo() { - return pb_1.Message.getField(this, 86) != null; - } static fromObject(data: { lifeSignal?: number; tc1Active?: boolean; @@ -3955,7 +4323,6 @@ export namespace state { atoCloseRightDoor?: boolean; lightAtoSend?: boolean; atoStepLevel?: TrainVobcState.AtoStepLevel; - vobcBtmInfo?: ReturnType; }): TrainVobcState { const message = new TrainVobcState({}); if (data.lifeSignal != null) { @@ -4201,9 +4568,6 @@ export namespace state { if (data.atoStepLevel != null) { message.atoStepLevel = data.atoStepLevel; } - if (data.vobcBtmInfo != null) { - message.vobcBtmInfo = TrainVobcState.VobcBtmInfo.fromObject(data.vobcBtmInfo); - } return message; } toObject() { @@ -4289,7 +4653,6 @@ export namespace state { atoCloseRightDoor?: boolean; lightAtoSend?: boolean; atoStepLevel?: TrainVobcState.AtoStepLevel; - vobcBtmInfo?: ReturnType; } = {}; if (this.lifeSignal != null) { data.lifeSignal = this.lifeSignal; @@ -4534,9 +4897,6 @@ export namespace state { if (this.atoStepLevel != null) { data.atoStepLevel = this.atoStepLevel; } - if (this.vobcBtmInfo != null) { - data.vobcBtmInfo = this.vobcBtmInfo.toObject(); - } return data; } serialize(): Uint8Array; @@ -4705,8 +5065,6 @@ export namespace state { writer.writeBool(84, this.lightAtoSend); if (this.atoStepLevel != TrainVobcState.AtoStepLevel.ATO_STEP_LEVEL_NONE) writer.writeEnum(85, this.atoStepLevel); - if (this.has_vobcBtmInfo) - writer.writeMessage(86, this.vobcBtmInfo, () => this.vobcBtmInfo.serialize(writer)); if (!w) return writer.getResultBuffer(); } @@ -4959,9 +5317,6 @@ export namespace state { case 85: message.atoStepLevel = reader.readEnum(); break; - case 86: - reader.readMessage(message.vobcBtmInfo, () => message.vobcBtmInfo = TrainVobcState.VobcBtmInfo.deserialize(reader)); - break; default: reader.skipField(); } } @@ -4985,119 +5340,6 @@ export namespace state { ATO_STEP_LEVEL_6 = 6, ATO_STEP_LEVEL_7 = 7 } - export class VobcBtmInfo extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - btmId?: number; - vobcId?: number; - vobcLifeId?: number; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("btmId" in data && data.btmId != undefined) { - this.btmId = data.btmId; - } - if ("vobcId" in data && data.vobcId != undefined) { - this.vobcId = data.vobcId; - } - if ("vobcLifeId" in data && data.vobcLifeId != undefined) { - this.vobcLifeId = data.vobcLifeId; - } - } - } - get btmId() { - return pb_1.Message.getFieldWithDefault(this, 1, 0) as number; - } - set btmId(value: number) { - pb_1.Message.setField(this, 1, value); - } - get vobcId() { - return pb_1.Message.getFieldWithDefault(this, 2, 0) as number; - } - set vobcId(value: number) { - pb_1.Message.setField(this, 2, value); - } - get vobcLifeId() { - return pb_1.Message.getFieldWithDefault(this, 3, 0) as number; - } - set vobcLifeId(value: number) { - pb_1.Message.setField(this, 3, value); - } - static fromObject(data: { - btmId?: number; - vobcId?: number; - vobcLifeId?: number; - }): VobcBtmInfo { - const message = new VobcBtmInfo({}); - if (data.btmId != null) { - message.btmId = data.btmId; - } - if (data.vobcId != null) { - message.vobcId = data.vobcId; - } - if (data.vobcLifeId != null) { - message.vobcLifeId = data.vobcLifeId; - } - return message; - } - toObject() { - const data: { - btmId?: number; - vobcId?: number; - vobcLifeId?: number; - } = {}; - if (this.btmId != null) { - data.btmId = this.btmId; - } - if (this.vobcId != null) { - data.vobcId = this.vobcId; - } - if (this.vobcLifeId != null) { - data.vobcLifeId = this.vobcLifeId; - } - 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.btmId != 0) - writer.writeUint32(1, this.btmId); - if (this.vobcId != 0) - writer.writeUint32(2, this.vobcId); - if (this.vobcLifeId != 0) - writer.writeUint32(3, this.vobcLifeId); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): VobcBtmInfo { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new VobcBtmInfo(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.btmId = reader.readUint32(); - break; - case 2: - message.vobcId = reader.readUint32(); - break; - case 3: - message.vobcLifeId = reader.readUint32(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): VobcBtmInfo { - return VobcBtmInfo.deserialize(bytes); - } - } } export class TrainMapState extends pb_1.Message { #one_of_decls: number[][] = []; @@ -5170,6 +5412,7 @@ export namespace state { tailDeviceId?: number; tailOffset?: number; tailDevicePort?: string; + btmState?: BTMState; connState?: TrainConnState; }) { super(); @@ -5379,6 +5622,9 @@ export namespace state { if ("tailDevicePort" in data && data.tailDevicePort != undefined) { this.tailDevicePort = data.tailDevicePort; } + if ("btmState" in data && data.btmState != undefined) { + this.btmState = data.btmState; + } if ("connState" in data && data.connState != undefined) { this.connState = data.connState; } @@ -5801,15 +6047,24 @@ export namespace state { set tailDevicePort(value: string) { pb_1.Message.setField(this, 68, value); } - get connState() { - return pb_1.Message.getWrapperField(this, TrainConnState, 69) as TrainConnState; + get btmState() { + return pb_1.Message.getWrapperField(this, BTMState, 69) as BTMState; } - set connState(value: TrainConnState) { + set btmState(value: BTMState) { pb_1.Message.setWrapperField(this, 69, value); } - get has_connState() { + get has_btmState() { return pb_1.Message.getField(this, 69) != null; } + get connState() { + return pb_1.Message.getWrapperField(this, TrainConnState, 70) as TrainConnState; + } + set connState(value: TrainConnState) { + pb_1.Message.setWrapperField(this, 70, value); + } + get has_connState() { + return pb_1.Message.getField(this, 70) != null; + } static fromObject(data: { id?: string; up?: boolean; @@ -5879,6 +6134,7 @@ export namespace state { tailDeviceId?: number; tailOffset?: number; tailDevicePort?: string; + btmState?: ReturnType; connState?: ReturnType; }): TrainMapState { const message = new TrainMapState({}); @@ -6086,6 +6342,9 @@ export namespace state { if (data.tailDevicePort != null) { message.tailDevicePort = data.tailDevicePort; } + if (data.btmState != null) { + message.btmState = BTMState.fromObject(data.btmState); + } if (data.connState != null) { message.connState = TrainConnState.fromObject(data.connState); } @@ -6161,6 +6420,7 @@ export namespace state { tailDeviceId?: number; tailOffset?: number; tailDevicePort?: string; + btmState?: ReturnType; connState?: ReturnType; } = {}; if (this.id != null) { @@ -6367,6 +6627,9 @@ export namespace state { if (this.tailDevicePort != null) { data.tailDevicePort = this.tailDevicePort; } + if (this.btmState != null) { + data.btmState = this.btmState.toObject(); + } if (this.connState != null) { data.connState = this.connState.toObject(); } @@ -6512,8 +6775,10 @@ export namespace state { writer.writeInt64(67, this.tailOffset); if (this.tailDevicePort.length) writer.writeString(68, this.tailDevicePort); + if (this.has_btmState) + writer.writeMessage(69, this.btmState, () => this.btmState.serialize(writer)); if (this.has_connState) - writer.writeMessage(69, this.connState, () => this.connState.serialize(writer)); + writer.writeMessage(70, this.connState, () => this.connState.serialize(writer)); if (!w) return writer.getResultBuffer(); } @@ -6728,6 +6993,9 @@ export namespace state { message.tailDevicePort = reader.readString(); break; case 69: + reader.readMessage(message.btmState, () => message.btmState = BTMState.deserialize(reader)); + break; + case 70: reader.readMessage(message.connState, () => message.connState = TrainConnState.deserialize(reader)); break; default: reader.skipField(); @@ -6755,7 +7023,6 @@ export namespace state { baliseType?: number; hasData?: boolean; resendCount?: number; - packageDataSN?: number; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); @@ -6790,9 +7057,6 @@ export namespace state { if ("resendCount" in data && data.resendCount != undefined) { this.resendCount = data.resendCount; } - if ("packageDataSN" in data && data.packageDataSN != undefined) { - this.packageDataSN = data.packageDataSN; - } } } get telegram() { @@ -6855,12 +7119,6 @@ export namespace state { set resendCount(value: number) { pb_1.Message.setField(this, 10, value); } - get packageDataSN() { - return pb_1.Message.getFieldWithDefault(this, 11, 0) as number; - } - set packageDataSN(value: number) { - pb_1.Message.setField(this, 11, value); - } static fromObject(data: { telegram?: string; aboveBalise?: boolean; @@ -6872,7 +7130,6 @@ export namespace state { baliseType?: number; hasData?: boolean; resendCount?: number; - packageDataSN?: number; }): BTMState { const message = new BTMState({}); if (data.telegram != null) { @@ -6905,9 +7162,6 @@ export namespace state { if (data.resendCount != null) { message.resendCount = data.resendCount; } - if (data.packageDataSN != null) { - message.packageDataSN = data.packageDataSN; - } return message; } toObject() { @@ -6922,7 +7176,6 @@ export namespace state { baliseType?: number; hasData?: boolean; resendCount?: number; - packageDataSN?: number; } = {}; if (this.telegram != null) { data.telegram = this.telegram; @@ -6954,9 +7207,6 @@ export namespace state { if (this.resendCount != null) { data.resendCount = this.resendCount; } - if (this.packageDataSN != null) { - data.packageDataSN = this.packageDataSN; - } return data; } serialize(): Uint8Array; @@ -6983,8 +7233,6 @@ export namespace state { writer.writeBool(9, this.hasData); if (this.resendCount != 0) writer.writeUint32(10, this.resendCount); - if (this.packageDataSN != 0) - writer.writeUint32(11, this.packageDataSN); if (!w) return writer.getResultBuffer(); } @@ -7024,9 +7272,6 @@ export namespace state { case 10: message.resendCount = reader.readUint32(); break; - case 11: - message.packageDataSN = reader.readUint32(); - break; default: reader.skipField(); } }