This commit is contained in:
joylink_fanyuhong 2024-10-08 15:33:45 +08:00
commit 34af6397ae

View File

@ -1275,7 +1275,6 @@ export namespace state {
tailDevicePort?: string; tailDevicePort?: string;
tcc?: TrainControlState; tcc?: TrainControlState;
connState?: TrainConnState; connState?: TrainConnState;
pluseCount?: SensorSpeedPulseCount;
oldLink?: string; oldLink?: string;
oldLinkOffset?: number; oldLinkOffset?: number;
oldTailLink?: string; oldTailLink?: string;
@ -1288,6 +1287,8 @@ export namespace state {
TrainMaxBrake?: number; TrainMaxBrake?: number;
TrainEmergencyBrake?: number; TrainEmergencyBrake?: number;
projectCode?: string; projectCode?: string;
trainPort?: TrainState.TrainPort;
pulseCountMap?: Map<number, SensorSpeedPulseCount>;
}) { }) {
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);
@ -1364,9 +1365,6 @@ export namespace state {
if ("connState" in data && data.connState != undefined) { if ("connState" in data && data.connState != undefined) {
this.connState = data.connState; this.connState = data.connState;
} }
if ("pluseCount" in data && data.pluseCount != undefined) {
this.pluseCount = data.pluseCount;
}
if ("oldLink" in data && data.oldLink != undefined) { if ("oldLink" in data && data.oldLink != undefined) {
this.oldLink = data.oldLink; this.oldLink = data.oldLink;
} }
@ -1403,7 +1401,15 @@ export namespace state {
if ("projectCode" in data && data.projectCode != undefined) { if ("projectCode" in data && data.projectCode != undefined) {
this.projectCode = data.projectCode; this.projectCode = data.projectCode;
} }
if ("trainPort" in data && data.trainPort != undefined) {
this.trainPort = data.trainPort;
}
if ("pulseCountMap" in data && data.pulseCountMap != undefined) {
this.pulseCountMap = data.pulseCountMap;
}
} }
if (!this.pulseCountMap)
this.pulseCountMap = new Map();
} }
get id() { get id() {
return pb_1.Message.getFieldWithDefault(this, 1, "") as string; return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
@ -1570,15 +1576,6 @@ export namespace state {
get has_connState() { get has_connState() {
return pb_1.Message.getField(this, 25) != null; return pb_1.Message.getField(this, 25) != null;
} }
get pluseCount() {
return pb_1.Message.getWrapperField(this, SensorSpeedPulseCount, 26) as SensorSpeedPulseCount;
}
set pluseCount(value: SensorSpeedPulseCount) {
pb_1.Message.setWrapperField(this, 26, value);
}
get has_pluseCount() {
return pb_1.Message.getField(this, 26) != null;
}
get oldLink() { get oldLink() {
return pb_1.Message.getFieldWithDefault(this, 28, "") as string; return pb_1.Message.getFieldWithDefault(this, 28, "") as string;
} }
@ -1657,6 +1654,18 @@ export namespace state {
set projectCode(value: string) { set projectCode(value: string) {
pb_1.Message.setField(this, 39, value); pb_1.Message.setField(this, 39, value);
} }
get trainPort() {
return pb_1.Message.getFieldWithDefault(this, 40, TrainState.TrainPort.PORT_NONE) as TrainState.TrainPort;
}
set trainPort(value: TrainState.TrainPort) {
pb_1.Message.setField(this, 40, value);
}
get pulseCountMap() {
return pb_1.Message.getField(this, 41) as any as Map<number, SensorSpeedPulseCount>;
}
set pulseCountMap(value: Map<number, SensorSpeedPulseCount>) {
pb_1.Message.setField(this, 41, value as any);
}
static fromObject(data: { static fromObject(data: {
id?: string; id?: string;
up?: boolean; up?: boolean;
@ -1682,7 +1691,6 @@ export namespace state {
tailDevicePort?: string; tailDevicePort?: string;
tcc?: ReturnType<typeof TrainControlState.prototype.toObject>; tcc?: ReturnType<typeof TrainControlState.prototype.toObject>;
connState?: ReturnType<typeof TrainConnState.prototype.toObject>; connState?: ReturnType<typeof TrainConnState.prototype.toObject>;
pluseCount?: ReturnType<typeof SensorSpeedPulseCount.prototype.toObject>;
oldLink?: string; oldLink?: string;
oldLinkOffset?: number; oldLinkOffset?: number;
oldTailLink?: string; oldTailLink?: string;
@ -1695,6 +1703,10 @@ export namespace state {
TrainMaxBrake?: number; TrainMaxBrake?: number;
TrainEmergencyBrake?: number; TrainEmergencyBrake?: number;
projectCode?: string; projectCode?: string;
trainPort?: TrainState.TrainPort;
pulseCountMap?: {
[key: number]: ReturnType<typeof SensorSpeedPulseCount.prototype.toObject>;
};
}): TrainState { }): TrainState {
const message = new TrainState({}); const message = new TrainState({});
if (data.id != null) { if (data.id != null) {
@ -1769,9 +1781,6 @@ export namespace state {
if (data.connState != null) { if (data.connState != null) {
message.connState = TrainConnState.fromObject(data.connState); message.connState = TrainConnState.fromObject(data.connState);
} }
if (data.pluseCount != null) {
message.pluseCount = SensorSpeedPulseCount.fromObject(data.pluseCount);
}
if (data.oldLink != null) { if (data.oldLink != null) {
message.oldLink = data.oldLink; message.oldLink = data.oldLink;
} }
@ -1808,6 +1817,12 @@ export namespace state {
if (data.projectCode != null) { if (data.projectCode != null) {
message.projectCode = data.projectCode; message.projectCode = data.projectCode;
} }
if (data.trainPort != null) {
message.trainPort = data.trainPort;
}
if (typeof data.pulseCountMap == "object") {
message.pulseCountMap = new Map(Object.entries(data.pulseCountMap).map(([key, value]) => [Number(key), SensorSpeedPulseCount.fromObject(value)]));
}
return message; return message;
} }
toObject() { toObject() {
@ -1836,7 +1851,6 @@ export namespace state {
tailDevicePort?: string; tailDevicePort?: string;
tcc?: ReturnType<typeof TrainControlState.prototype.toObject>; tcc?: ReturnType<typeof TrainControlState.prototype.toObject>;
connState?: ReturnType<typeof TrainConnState.prototype.toObject>; connState?: ReturnType<typeof TrainConnState.prototype.toObject>;
pluseCount?: ReturnType<typeof SensorSpeedPulseCount.prototype.toObject>;
oldLink?: string; oldLink?: string;
oldLinkOffset?: number; oldLinkOffset?: number;
oldTailLink?: string; oldTailLink?: string;
@ -1849,6 +1863,10 @@ export namespace state {
TrainMaxBrake?: number; TrainMaxBrake?: number;
TrainEmergencyBrake?: number; TrainEmergencyBrake?: number;
projectCode?: string; projectCode?: string;
trainPort?: TrainState.TrainPort;
pulseCountMap?: {
[key: number]: ReturnType<typeof SensorSpeedPulseCount.prototype.toObject>;
};
} = {}; } = {};
if (this.id != null) { if (this.id != null) {
data.id = this.id; data.id = this.id;
@ -1922,9 +1940,6 @@ export namespace state {
if (this.connState != null) { if (this.connState != null) {
data.connState = this.connState.toObject(); data.connState = this.connState.toObject();
} }
if (this.pluseCount != null) {
data.pluseCount = this.pluseCount.toObject();
}
if (this.oldLink != null) { if (this.oldLink != null) {
data.oldLink = this.oldLink; data.oldLink = this.oldLink;
} }
@ -1961,6 +1976,12 @@ export namespace state {
if (this.projectCode != null) { if (this.projectCode != null) {
data.projectCode = this.projectCode; data.projectCode = this.projectCode;
} }
if (this.trainPort != null) {
data.trainPort = this.trainPort;
}
if (this.pulseCountMap != null) {
data.pulseCountMap = (Object.fromEntries)((Array.from)(this.pulseCountMap).map(([key, value]) => [key, value.toObject()]));
}
return data; return data;
} }
serialize(): Uint8Array; serialize(): Uint8Array;
@ -2015,8 +2036,6 @@ export namespace state {
writer.writeMessage(24, this.tcc, () => this.tcc.serialize(writer)); writer.writeMessage(24, this.tcc, () => this.tcc.serialize(writer));
if (this.has_connState) if (this.has_connState)
writer.writeMessage(25, this.connState, () => this.connState.serialize(writer)); writer.writeMessage(25, this.connState, () => this.connState.serialize(writer));
if (this.has_pluseCount)
writer.writeMessage(26, this.pluseCount, () => this.pluseCount.serialize(writer));
if (this.oldLink.length) if (this.oldLink.length)
writer.writeString(28, this.oldLink); writer.writeString(28, this.oldLink);
if (this.oldLinkOffset != 0) if (this.oldLinkOffset != 0)
@ -2041,6 +2060,14 @@ export namespace state {
writer.writeFloat(38, this.TrainEmergencyBrake); writer.writeFloat(38, this.TrainEmergencyBrake);
if (this.projectCode.length) if (this.projectCode.length)
writer.writeString(39, this.projectCode); writer.writeString(39, this.projectCode);
if (this.trainPort != TrainState.TrainPort.PORT_NONE)
writer.writeEnum(40, this.trainPort);
for (const [key, value] of this.pulseCountMap) {
writer.writeMessage(41, this.pulseCountMap, () => {
writer.writeInt32(1, key);
writer.writeMessage(2, value, () => value.serialize(writer));
});
}
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
} }
@ -2122,9 +2149,6 @@ export namespace state {
case 25: case 25:
reader.readMessage(message.connState, () => message.connState = TrainConnState.deserialize(reader)); reader.readMessage(message.connState, () => message.connState = TrainConnState.deserialize(reader));
break; break;
case 26:
reader.readMessage(message.pluseCount, () => message.pluseCount = SensorSpeedPulseCount.deserialize(reader));
break;
case 28: case 28:
message.oldLink = reader.readString(); message.oldLink = reader.readString();
break; break;
@ -2161,6 +2185,16 @@ export namespace state {
case 39: case 39:
message.projectCode = reader.readString(); message.projectCode = reader.readString();
break; break;
case 40:
message.trainPort = reader.readEnum();
break;
case 41:
reader.readMessage(message, () => pb_1.Map.deserializeBinary(message.pulseCountMap as any, reader, reader.readInt32, () => {
let value;
reader.readMessage(message, () => value = SensorSpeedPulseCount.deserialize(reader));
return value;
}));
break;
default: reader.skipField(); default: reader.skipField();
} }
} }
@ -2173,6 +2207,13 @@ export namespace state {
return TrainState.deserialize(bytes); return TrainState.deserialize(bytes);
} }
} }
export namespace TrainState {
export enum TrainPort {
PORT_NONE = 0,
PORT_A = 1,
PORT_B = 2
}
}
export class TrainBtmCache extends pb_1.Message { export class TrainBtmCache extends pb_1.Message {
#one_of_decls: number[][] = []; #one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
@ -2336,25 +2377,17 @@ export namespace state {
#one_of_decls: number[][] = []; #one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
pulseCount1?: number; pulseCount1?: number;
pulseCount2?: number;
pulseCount3?: number[]; pulseCount3?: number[];
pulseCount4?: number[];
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3, 4], this.#one_of_decls); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("pulseCount1" in data && data.pulseCount1 != undefined) { if ("pulseCount1" in data && data.pulseCount1 != undefined) {
this.pulseCount1 = data.pulseCount1; this.pulseCount1 = data.pulseCount1;
} }
if ("pulseCount2" in data && data.pulseCount2 != undefined) {
this.pulseCount2 = data.pulseCount2;
}
if ("pulseCount3" in data && data.pulseCount3 != undefined) { if ("pulseCount3" in data && data.pulseCount3 != undefined) {
this.pulseCount3 = data.pulseCount3; this.pulseCount3 = data.pulseCount3;
} }
if ("pulseCount4" in data && data.pulseCount4 != undefined) {
this.pulseCount4 = data.pulseCount4;
}
} }
} }
get pulseCount1() { get pulseCount1() {
@ -2363,64 +2396,36 @@ export namespace state {
set pulseCount1(value: number) { set pulseCount1(value: number) {
pb_1.Message.setField(this, 1, value); pb_1.Message.setField(this, 1, value);
} }
get pulseCount2() {
return pb_1.Message.getFieldWithDefault(this, 2, 0) as number;
}
set pulseCount2(value: number) {
pb_1.Message.setField(this, 2, value);
}
get pulseCount3() { get pulseCount3() {
return pb_1.Message.getFieldWithDefault(this, 3, []) as number[]; return pb_1.Message.getFieldWithDefault(this, 3, []) as number[];
} }
set pulseCount3(value: number[]) { set pulseCount3(value: number[]) {
pb_1.Message.setField(this, 3, value); pb_1.Message.setField(this, 3, value);
} }
get pulseCount4() {
return pb_1.Message.getFieldWithDefault(this, 4, []) as number[];
}
set pulseCount4(value: number[]) {
pb_1.Message.setField(this, 4, value);
}
static fromObject(data: { static fromObject(data: {
pulseCount1?: number; pulseCount1?: number;
pulseCount2?: number;
pulseCount3?: number[]; pulseCount3?: number[];
pulseCount4?: number[];
}): SensorSpeedPulseCount { }): SensorSpeedPulseCount {
const message = new SensorSpeedPulseCount({}); const message = new SensorSpeedPulseCount({});
if (data.pulseCount1 != null) { if (data.pulseCount1 != null) {
message.pulseCount1 = data.pulseCount1; message.pulseCount1 = data.pulseCount1;
} }
if (data.pulseCount2 != null) {
message.pulseCount2 = data.pulseCount2;
}
if (data.pulseCount3 != null) { if (data.pulseCount3 != null) {
message.pulseCount3 = data.pulseCount3; message.pulseCount3 = data.pulseCount3;
} }
if (data.pulseCount4 != null) {
message.pulseCount4 = data.pulseCount4;
}
return message; return message;
} }
toObject() { toObject() {
const data: { const data: {
pulseCount1?: number; pulseCount1?: number;
pulseCount2?: number;
pulseCount3?: number[]; pulseCount3?: number[];
pulseCount4?: number[];
} = {}; } = {};
if (this.pulseCount1 != null) { if (this.pulseCount1 != null) {
data.pulseCount1 = this.pulseCount1; data.pulseCount1 = this.pulseCount1;
} }
if (this.pulseCount2 != null) {
data.pulseCount2 = this.pulseCount2;
}
if (this.pulseCount3 != null) { if (this.pulseCount3 != null) {
data.pulseCount3 = this.pulseCount3; data.pulseCount3 = this.pulseCount3;
} }
if (this.pulseCount4 != null) {
data.pulseCount4 = this.pulseCount4;
}
return data; return data;
} }
serialize(): Uint8Array; serialize(): Uint8Array;
@ -2429,12 +2434,8 @@ export namespace state {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (this.pulseCount1 != 0) if (this.pulseCount1 != 0)
writer.writeUint32(1, this.pulseCount1); writer.writeUint32(1, this.pulseCount1);
if (this.pulseCount2 != 0)
writer.writeUint32(2, this.pulseCount2);
if (this.pulseCount3.length) if (this.pulseCount3.length)
writer.writePackedFloat(3, this.pulseCount3); writer.writePackedFloat(3, this.pulseCount3);
if (this.pulseCount4.length)
writer.writePackedFloat(4, this.pulseCount4);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
} }
@ -2447,15 +2448,9 @@ export namespace state {
case 1: case 1:
message.pulseCount1 = reader.readUint32(); message.pulseCount1 = reader.readUint32();
break; break;
case 2:
message.pulseCount2 = reader.readUint32();
break;
case 3: case 3:
message.pulseCount3 = reader.readPackedFloat(); message.pulseCount3 = reader.readPackedFloat();
break; break;
case 4:
message.pulseCount4 = reader.readPackedFloat();
break;
default: reader.skipField(); default: reader.skipField();
} }
} }
@ -10568,8 +10563,6 @@ export namespace state {
switchKeyMap?: Map<string, TrainControlState.SwitchKeyChange>; switchKeyMap?: Map<string, TrainControlState.SwitchKeyChange>;
pushHandler?: TrainControlState.PushHandler; pushHandler?: TrainControlState.PushHandler;
lightMaps?: Map<string, TrainControlState.ControlLight>; lightMaps?: Map<string, TrainControlState.ControlLight>;
lineInitTimeStamp12?: number;
line12ConnErr?: boolean;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], this.#one_of_decls); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], this.#one_of_decls);
@ -10589,12 +10582,6 @@ export namespace state {
if ("lightMaps" in data && data.lightMaps != undefined) { if ("lightMaps" in data && data.lightMaps != undefined) {
this.lightMaps = data.lightMaps; this.lightMaps = data.lightMaps;
} }
if ("lineInitTimeStamp12" in data && data.lineInitTimeStamp12 != undefined) {
this.lineInitTimeStamp12 = data.lineInitTimeStamp12;
}
if ("line12ConnErr" in data && data.line12ConnErr != undefined) {
this.line12ConnErr = data.line12ConnErr;
}
} }
if (!this.buttons) if (!this.buttons)
this.buttons = new Map(); this.buttons = new Map();
@ -10636,18 +10623,6 @@ export namespace state {
set lightMaps(value: Map<string, TrainControlState.ControlLight>) { set lightMaps(value: Map<string, TrainControlState.ControlLight>) {
pb_1.Message.setField(this, 5, value as any); pb_1.Message.setField(this, 5, value as any);
} }
get lineInitTimeStamp12() {
return pb_1.Message.getFieldWithDefault(this, 6, 0) as number;
}
set lineInitTimeStamp12(value: number) {
pb_1.Message.setField(this, 6, value);
}
get line12ConnErr() {
return pb_1.Message.getFieldWithDefault(this, 7, false) as boolean;
}
set line12ConnErr(value: boolean) {
pb_1.Message.setField(this, 7, value);
}
static fromObject(data: { static fromObject(data: {
buttons?: { buttons?: {
[key: string]: ReturnType<typeof TrainControlState.ControlButton.prototype.toObject>; [key: string]: ReturnType<typeof TrainControlState.ControlButton.prototype.toObject>;
@ -10660,8 +10635,6 @@ export namespace state {
lightMaps?: { lightMaps?: {
[key: string]: ReturnType<typeof TrainControlState.ControlLight.prototype.toObject>; [key: string]: ReturnType<typeof TrainControlState.ControlLight.prototype.toObject>;
}; };
lineInitTimeStamp12?: number;
line12ConnErr?: boolean;
}): TrainControlState { }): TrainControlState {
const message = new TrainControlState({}); const message = new TrainControlState({});
if (typeof data.buttons == "object") { if (typeof data.buttons == "object") {
@ -10679,12 +10652,6 @@ export namespace state {
if (typeof data.lightMaps == "object") { if (typeof data.lightMaps == "object") {
message.lightMaps = new Map(Object.entries(data.lightMaps).map(([key, value]) => [key, TrainControlState.ControlLight.fromObject(value)])); message.lightMaps = new Map(Object.entries(data.lightMaps).map(([key, value]) => [key, TrainControlState.ControlLight.fromObject(value)]));
} }
if (data.lineInitTimeStamp12 != null) {
message.lineInitTimeStamp12 = data.lineInitTimeStamp12;
}
if (data.line12ConnErr != null) {
message.line12ConnErr = data.line12ConnErr;
}
return message; return message;
} }
toObject() { toObject() {
@ -10700,8 +10667,6 @@ export namespace state {
lightMaps?: { lightMaps?: {
[key: string]: ReturnType<typeof TrainControlState.ControlLight.prototype.toObject>; [key: string]: ReturnType<typeof TrainControlState.ControlLight.prototype.toObject>;
}; };
lineInitTimeStamp12?: number;
line12ConnErr?: boolean;
} = {}; } = {};
if (this.buttons != null) { if (this.buttons != null) {
data.buttons = (Object.fromEntries)((Array.from)(this.buttons).map(([key, value]) => [key, value.toObject()])); data.buttons = (Object.fromEntries)((Array.from)(this.buttons).map(([key, value]) => [key, value.toObject()]));
@ -10718,12 +10683,6 @@ export namespace state {
if (this.lightMaps != null) { if (this.lightMaps != null) {
data.lightMaps = (Object.fromEntries)((Array.from)(this.lightMaps).map(([key, value]) => [key, value.toObject()])); data.lightMaps = (Object.fromEntries)((Array.from)(this.lightMaps).map(([key, value]) => [key, value.toObject()]));
} }
if (this.lineInitTimeStamp12 != null) {
data.lineInitTimeStamp12 = this.lineInitTimeStamp12;
}
if (this.line12ConnErr != null) {
data.line12ConnErr = this.line12ConnErr;
}
return data; return data;
} }
serialize(): Uint8Array; serialize(): Uint8Array;
@ -10752,10 +10711,6 @@ export namespace state {
writer.writeMessage(2, value, () => value.serialize(writer)); writer.writeMessage(2, value, () => value.serialize(writer));
}); });
} }
if (this.lineInitTimeStamp12 != 0)
writer.writeInt64(6, this.lineInitTimeStamp12);
if (this.line12ConnErr != false)
writer.writeBool(7, this.line12ConnErr);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
} }
@ -10792,12 +10747,6 @@ export namespace state {
return value; return value;
})); }));
break; break;
case 6:
message.lineInitTimeStamp12 = reader.readInt64();
break;
case 7:
message.line12ConnErr = reader.readBool();
break;
default: reader.skipField(); default: reader.skipField();
} }
} }