diff --git a/rts-sim-testing-message b/rts-sim-testing-message index 67d7d79..7629f29 160000 --- a/rts-sim-testing-message +++ b/rts-sim-testing-message @@ -1 +1 @@ -Subproject commit 67d7d79c5a50880b61be05d98184209422f15f1b +Subproject commit 7629f290ea612d4ce368c40d4cf793dffc4b21ec diff --git a/src/api/TrainModelApi.ts b/src/api/TrainModelApi.ts index 78f3607..06e5c08 100644 --- a/src/api/TrainModelApi.ts +++ b/src/api/TrainModelApi.ts @@ -60,6 +60,7 @@ export interface TrainCreateParams { train_max_speed: number; train_max_acc: number; train_max_brake: number; + train_emergency_brake: number; trainConfigData?: TrainConfigData; trainControlMapId: number; } diff --git a/src/components/draw-app/dialogs/AddTrainDialog.vue b/src/components/draw-app/dialogs/AddTrainDialog.vue index 86941cf..d778e38 100644 --- a/src/components/draw-app/dialogs/AddTrainDialog.vue +++ b/src/components/draw-app/dialogs/AddTrainDialog.vue @@ -175,6 +175,7 @@ function onCreate() { trainMaxSpeed: trainConfig.value.train_max_speed, trainMaxAcc: trainConfig.value.train_max_acc, trainMaxBrake: trainConfig.value.train_max_brake, + trainEmergencyBrake: trainConfig.value.train_emergency_brake, configTrain: trainConfig.value.trainConfigData as TrainConfigData, trainControlMapId: trainConfig.value.trainControlMapId, trainEndsA: { @@ -226,6 +227,7 @@ const trainConfig = ref({ train_max_speed: 0, train_max_acc: 0, train_max_brake: 0, + train_emergency_brake: 0, trainControlMapId: 0, }); function setConfigVal(val: TrainConfigItem | null) { diff --git a/src/pages/TrainModelManage.vue b/src/pages/TrainModelManage.vue index da0cc1b..4f65577 100644 --- a/src/pages/TrainModelManage.vue +++ b/src/pages/TrainModelManage.vue @@ -194,7 +194,15 @@ + +
+
@@ -563,6 +571,7 @@ function onCreate() { train_max_speed: editInfo.train_max_speed, train_max_acc: editInfo.train_max_acc, train_max_brake: editInfo.train_max_brake, + train_emergency_brake: editInfo.train_emergency_brake, trainConfigData: editInfo.trainConfigData, trainControlMapId: editInfo.trainControlMapId, }; @@ -598,6 +607,7 @@ function onReset() { editInfo.train_max_speed = 0; editInfo.train_max_acc = 0; editInfo.train_max_brake = 0; + editInfo.train_emergency_brake = 0; // editInfo.min_diameter = 0; // editInfo.max_diameter = 0; editInfo.train_sets = ''; @@ -660,6 +670,7 @@ interface EditCreateItem extends TrainCreateParams { train_max_speed: number; train_max_acc: number; train_max_brake: number; + train_emergency_brake: number; trainControlMapId: number; trainConfigData: { davisParamA: number; @@ -696,6 +707,7 @@ const editInfo = reactive({ train_max_speed: 0, train_max_acc: 0, train_max_brake: 0, + train_emergency_brake: 0, trainControlMapId: 0, trainConfigData: { davisParamA: 2.25, @@ -730,6 +742,7 @@ function editData(row: TrainItem) { editInfo.train_max_speed = res.train_max_speed; editInfo.train_max_acc = res.train_max_acc; editInfo.train_max_brake = res.train_max_brake; + editInfo.train_emergency_brake = res.train_emergency_brake; // editInfo.min_diameter = res.min_diameter; // editInfo.max_diameter = res.max_diameter; editInfo.train_sets = res.train_sets; diff --git a/src/protos/device_state.ts b/src/protos/device_state.ts index 5c3c44c..8a5d9df 100644 --- a/src/protos/device_state.ts +++ b/src/protos/device_state.ts @@ -1281,6 +1281,11 @@ export namespace state { oldLink?: string; oldLinkOffset?: number; btmBaliseCache?: TrainBtmCache; + TrainLoad?: number; + TrainMaxSpeed?: number; + TrainMaxAcc?: number; + TrainMaxBrake?: number; + TrainEmergencyBrake?: number; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); @@ -1375,6 +1380,21 @@ export namespace state { if ("btmBaliseCache" in data && data.btmBaliseCache != undefined) { this.btmBaliseCache = data.btmBaliseCache; } + if ("TrainLoad" in data && data.TrainLoad != undefined) { + this.TrainLoad = data.TrainLoad; + } + if ("TrainMaxSpeed" in data && data.TrainMaxSpeed != undefined) { + this.TrainMaxSpeed = data.TrainMaxSpeed; + } + if ("TrainMaxAcc" in data && data.TrainMaxAcc != undefined) { + this.TrainMaxAcc = data.TrainMaxAcc; + } + if ("TrainMaxBrake" in data && data.TrainMaxBrake != undefined) { + this.TrainMaxBrake = data.TrainMaxBrake; + } + if ("TrainEmergencyBrake" in data && data.TrainEmergencyBrake != undefined) { + this.TrainEmergencyBrake = data.TrainEmergencyBrake; + } } } get id() { @@ -1590,6 +1610,36 @@ export namespace state { get has_btmBaliseCache() { return pb_1.Message.getField(this, 30) != null; } + get TrainLoad() { + return pb_1.Message.getFieldWithDefault(this, 31, 0) as number; + } + set TrainLoad(value: number) { + pb_1.Message.setField(this, 31, value); + } + get TrainMaxSpeed() { + return pb_1.Message.getFieldWithDefault(this, 32, 0) as number; + } + set TrainMaxSpeed(value: number) { + pb_1.Message.setField(this, 32, value); + } + get TrainMaxAcc() { + return pb_1.Message.getFieldWithDefault(this, 33, 0) as number; + } + set TrainMaxAcc(value: number) { + pb_1.Message.setField(this, 33, value); + } + get TrainMaxBrake() { + return pb_1.Message.getFieldWithDefault(this, 34, 0) as number; + } + set TrainMaxBrake(value: number) { + pb_1.Message.setField(this, 34, value); + } + get TrainEmergencyBrake() { + return pb_1.Message.getFieldWithDefault(this, 35, 0) as number; + } + set TrainEmergencyBrake(value: number) { + pb_1.Message.setField(this, 35, value); + } static fromObject(data: { id?: string; up?: boolean; @@ -1621,6 +1671,11 @@ export namespace state { oldLink?: string; oldLinkOffset?: number; btmBaliseCache?: ReturnType; + TrainLoad?: number; + TrainMaxSpeed?: number; + TrainMaxAcc?: number; + TrainMaxBrake?: number; + TrainEmergencyBrake?: number; }): TrainState { const message = new TrainState({}); if (data.id != null) { @@ -1713,6 +1768,21 @@ export namespace state { if (data.btmBaliseCache != null) { message.btmBaliseCache = TrainBtmCache.fromObject(data.btmBaliseCache); } + if (data.TrainLoad != null) { + message.TrainLoad = data.TrainLoad; + } + if (data.TrainMaxSpeed != null) { + message.TrainMaxSpeed = data.TrainMaxSpeed; + } + if (data.TrainMaxAcc != null) { + message.TrainMaxAcc = data.TrainMaxAcc; + } + if (data.TrainMaxBrake != null) { + message.TrainMaxBrake = data.TrainMaxBrake; + } + if (data.TrainEmergencyBrake != null) { + message.TrainEmergencyBrake = data.TrainEmergencyBrake; + } return message; } toObject() { @@ -1747,6 +1817,11 @@ export namespace state { oldLink?: string; oldLinkOffset?: number; btmBaliseCache?: ReturnType; + TrainLoad?: number; + TrainMaxSpeed?: number; + TrainMaxAcc?: number; + TrainMaxBrake?: number; + TrainEmergencyBrake?: number; } = {}; if (this.id != null) { data.id = this.id; @@ -1838,6 +1913,21 @@ export namespace state { if (this.btmBaliseCache != null) { data.btmBaliseCache = this.btmBaliseCache.toObject(); } + if (this.TrainLoad != null) { + data.TrainLoad = this.TrainLoad; + } + if (this.TrainMaxSpeed != null) { + data.TrainMaxSpeed = this.TrainMaxSpeed; + } + if (this.TrainMaxAcc != null) { + data.TrainMaxAcc = this.TrainMaxAcc; + } + if (this.TrainMaxBrake != null) { + data.TrainMaxBrake = this.TrainMaxBrake; + } + if (this.TrainEmergencyBrake != null) { + data.TrainEmergencyBrake = this.TrainEmergencyBrake; + } return data; } serialize(): Uint8Array; @@ -1904,6 +1994,16 @@ export namespace state { writer.writeInt64(29, this.oldLinkOffset); if (this.has_btmBaliseCache) writer.writeMessage(30, this.btmBaliseCache, () => this.btmBaliseCache.serialize(writer)); + if (this.TrainLoad != 0) + writer.writeInt32(31, this.TrainLoad); + if (this.TrainMaxSpeed != 0) + writer.writeFloat(32, this.TrainMaxSpeed); + if (this.TrainMaxAcc != 0) + writer.writeFloat(33, this.TrainMaxAcc); + if (this.TrainMaxBrake != 0) + writer.writeFloat(34, this.TrainMaxBrake); + if (this.TrainEmergencyBrake != 0) + writer.writeFloat(35, this.TrainEmergencyBrake); if (!w) return writer.getResultBuffer(); } @@ -2003,6 +2103,21 @@ export namespace state { case 30: reader.readMessage(message.btmBaliseCache, () => message.btmBaliseCache = TrainBtmCache.deserialize(reader)); break; + case 31: + message.TrainLoad = reader.readInt32(); + break; + case 32: + message.TrainMaxSpeed = reader.readFloat(); + break; + case 33: + message.TrainMaxAcc = reader.readFloat(); + break; + case 34: + message.TrainMaxBrake = reader.readFloat(); + break; + case 35: + message.TrainEmergencyBrake = reader.readFloat(); + break; default: reader.skipField(); } } @@ -3390,6 +3505,7 @@ export namespace state { trainConnInitComplate?: boolean; atoCloseRightDoor?: boolean; lightAtoSend?: boolean; + atoStepLevel?: TrainVobcState.AtoStepLevel; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); @@ -3634,6 +3750,9 @@ export namespace state { if ("lightAtoSend" in data && data.lightAtoSend != undefined) { this.lightAtoSend = data.lightAtoSend; } + if ("atoStepLevel" in data && data.atoStepLevel != undefined) { + this.atoStepLevel = data.atoStepLevel; + } } } get lifeSignal() { @@ -4116,6 +4235,12 @@ export namespace state { set lightAtoSend(value: boolean) { pb_1.Message.setField(this, 84, value); } + get atoStepLevel() { + return pb_1.Message.getFieldWithDefault(this, 85, TrainVobcState.AtoStepLevel.ATO_STEP_LEVEL_NONE) as TrainVobcState.AtoStepLevel; + } + set atoStepLevel(value: TrainVobcState.AtoStepLevel) { + pb_1.Message.setField(this, 85, value); + } static fromObject(data: { lifeSignal?: number; tc1Active?: boolean; @@ -4197,6 +4322,7 @@ export namespace state { trainConnInitComplate?: boolean; atoCloseRightDoor?: boolean; lightAtoSend?: boolean; + atoStepLevel?: TrainVobcState.AtoStepLevel; }): TrainVobcState { const message = new TrainVobcState({}); if (data.lifeSignal != null) { @@ -4439,6 +4565,9 @@ export namespace state { if (data.lightAtoSend != null) { message.lightAtoSend = data.lightAtoSend; } + if (data.atoStepLevel != null) { + message.atoStepLevel = data.atoStepLevel; + } return message; } toObject() { @@ -4523,6 +4652,7 @@ export namespace state { trainConnInitComplate?: boolean; atoCloseRightDoor?: boolean; lightAtoSend?: boolean; + atoStepLevel?: TrainVobcState.AtoStepLevel; } = {}; if (this.lifeSignal != null) { data.lifeSignal = this.lifeSignal; @@ -4764,6 +4894,9 @@ export namespace state { if (this.lightAtoSend != null) { data.lightAtoSend = this.lightAtoSend; } + if (this.atoStepLevel != null) { + data.atoStepLevel = this.atoStepLevel; + } return data; } serialize(): Uint8Array; @@ -4930,6 +5063,8 @@ export namespace state { writer.writeBool(83, this.atoCloseRightDoor); if (this.lightAtoSend != false) writer.writeBool(84, this.lightAtoSend); + if (this.atoStepLevel != TrainVobcState.AtoStepLevel.ATO_STEP_LEVEL_NONE) + writer.writeEnum(85, this.atoStepLevel); if (!w) return writer.getResultBuffer(); } @@ -5179,6 +5314,9 @@ export namespace state { case 84: message.lightAtoSend = reader.readBool(); break; + case 85: + message.atoStepLevel = reader.readEnum(); + break; default: reader.skipField(); } } @@ -5191,6 +5329,18 @@ export namespace state { return TrainVobcState.deserialize(bytes); } } + export namespace TrainVobcState { + export enum AtoStepLevel { + ATO_STEP_LEVEL_NONE = 0, + ATO_STEP_LEVEL_1 = 1, + ATO_STEP_LEVEL_2 = 2, + ATO_STEP_LEVEL_3 = 3, + ATO_STEP_LEVEL_4 = 4, + ATO_STEP_LEVEL_5 = 5, + ATO_STEP_LEVEL_6 = 6, + ATO_STEP_LEVEL_7 = 7 + } + } export class TrainMapState extends pb_1.Message { #one_of_decls: number[][] = []; constructor(data?: any[] | { diff --git a/src/protos/stationLayoutGraphics.ts b/src/protos/stationLayoutGraphics.ts index c95b09b..065e876 100644 --- a/src/protos/stationLayoutGraphics.ts +++ b/src/protos/stationLayoutGraphics.ts @@ -9088,6 +9088,7 @@ export namespace graphicData { trainMaxSpeed?: number; trainMaxAcc?: number; trainMaxBrake?: number; + TrainEmergencyBrake?: number; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); @@ -9122,6 +9123,9 @@ export namespace graphicData { if ("trainMaxBrake" in data && data.trainMaxBrake != undefined) { this.trainMaxBrake = data.trainMaxBrake; } + if ("TrainEmergencyBrake" in data && data.TrainEmergencyBrake != undefined) { + this.TrainEmergencyBrake = data.TrainEmergencyBrake; + } } } get trainModel() { @@ -9187,6 +9191,12 @@ export namespace graphicData { set trainMaxBrake(value: number) { pb_1.Message.setField(this, 13, value); } + get TrainEmergencyBrake() { + return pb_1.Message.getFieldWithDefault(this, 14, 0) as number; + } + set TrainEmergencyBrake(value: number) { + pb_1.Message.setField(this, 14, value); + } static fromObject(data: { trainModel?: Train.TrainModel; carriageLength?: number; @@ -9198,6 +9208,7 @@ export namespace graphicData { trainMaxSpeed?: number; trainMaxAcc?: number; trainMaxBrake?: number; + TrainEmergencyBrake?: number; }): Train { const message = new Train({}); if (data.trainModel != null) { @@ -9230,6 +9241,9 @@ export namespace graphicData { if (data.trainMaxBrake != null) { message.trainMaxBrake = data.trainMaxBrake; } + if (data.TrainEmergencyBrake != null) { + message.TrainEmergencyBrake = data.TrainEmergencyBrake; + } return message; } toObject() { @@ -9244,6 +9258,7 @@ export namespace graphicData { trainMaxSpeed?: number; trainMaxAcc?: number; trainMaxBrake?: number; + TrainEmergencyBrake?: number; } = {}; if (this.trainModel != null) { data.trainModel = this.trainModel; @@ -9275,6 +9290,9 @@ export namespace graphicData { if (this.trainMaxBrake != null) { data.trainMaxBrake = this.trainMaxBrake; } + if (this.TrainEmergencyBrake != null) { + data.TrainEmergencyBrake = this.TrainEmergencyBrake; + } return data; } serialize(): Uint8Array; @@ -9301,6 +9319,8 @@ export namespace graphicData { writer.writeFloat(12, this.trainMaxAcc); if (this.trainMaxBrake != 0) writer.writeFloat(13, this.trainMaxBrake); + if (this.TrainEmergencyBrake != 0) + writer.writeFloat(14, this.TrainEmergencyBrake); if (!w) return writer.getResultBuffer(); } @@ -9340,6 +9360,9 @@ export namespace graphicData { case 13: message.trainMaxBrake = reader.readFloat(); break; + case 14: + message.TrainEmergencyBrake = reader.readFloat(); + break; default: reader.skipField(); } }