From 8f9c0c852a56ab040f46075e4a837b9acbb6920a Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Thu, 22 Aug 2024 14:31:15 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E9=A9=BE=E9=A9=B6=E5=8F=B0=E6=97=8B?= =?UTF-8?q?=E9=92=AE=E6=93=8D=E4=BD=9Cbug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/drawApp/graphics/TccKeyInteraction.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/drawApp/graphics/TccKeyInteraction.ts b/src/drawApp/graphics/TccKeyInteraction.ts index d5986dc..d4be1b3 100644 --- a/src/drawApp/graphics/TccKeyInteraction.ts +++ b/src/drawApp/graphics/TccKeyInteraction.ts @@ -148,9 +148,10 @@ export abstract class KeyInteraction< } onMouseDown(e: FederatedMouseEvent) { const target = e.target as DisplayObject; - const g = target.getGraphic(); + const g = target.getGraphic(); if (!g) return; this.isMouseDown = true; + this.ratatingSprite = g._tccKey; this.mouseDownBeginPos = this.app.toCanvasCoordinates(e.global); this.mouseDownBeginRotation = this.ratatingSprite.rotation; this.changeRotation = this.mouseDownBeginRotation; From 0ac19e5d35f5eded7a7516a463b254d0547a94ba Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Tue, 27 Aug 2024 11:44:09 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E5=8F=82=E6=95=B0=EF=BC=88=E9=97=A8=E6=A8=A1=E5=BC=8F=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/tcc-store.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/stores/tcc-store.ts b/src/stores/tcc-store.ts index 29c2497..9bbbab9 100644 --- a/src/stores/tcc-store.ts +++ b/src/stores/tcc-store.ts @@ -78,13 +78,20 @@ export const useTccStore = defineStore('tcc', { position = 2; break; } + let controlType = + request.TrainControl.TrainControlType.DIRECTION_KEY_SWITCH; + if (tccKeyDir.datas.code == 'MMS') { + controlType = + request.TrainControl.TrainControlType.TRAIN_DOOR_MODE_CHANGE; + } + const simulationId = useLineStore().simulationId; if (!simulationId) return; tccOperation({ simulationId, trainId: this.tccId + '', deviceId: this.tccKeyDirId, - controlType: request.TrainControl.TrainControlType.DIRECTION_KEY_SWITCH, + controlType, switchKey: { val: position, }, From 3c856ec37c053d5caad5cb1125a5bef2004cf880 Mon Sep 17 00:00:00 2001 From: fan Date: Thu, 29 Aug 2024 16:14:30 +0800 Subject: [PATCH 3/6] =?UTF-8?q?protoc=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rts-sim-testing-message | 2 +- src/protos/common_data.ts | 23 +++++++++++++++++++ src/protos/device_state.ts | 46 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 70 insertions(+), 1 deletion(-) diff --git a/rts-sim-testing-message b/rts-sim-testing-message index 939b7a2..67d7d79 160000 --- a/rts-sim-testing-message +++ b/rts-sim-testing-message @@ -1 +1 @@ -Subproject commit 939b7a2604a29cb3d486199cc9491af49f81a2f3 +Subproject commit 67d7d79c5a50880b61be05d98184209422f15f1b diff --git a/src/protos/common_data.ts b/src/protos/common_data.ts index 47810d5..f1f5c9d 100644 --- a/src/protos/common_data.ts +++ b/src/protos/common_data.ts @@ -26,6 +26,7 @@ export namespace common { stopSign?: number; slide?: number; trainLoad?: number; + maxSpeed?: number; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); @@ -84,6 +85,9 @@ export namespace common { if ("trainLoad" in data && data.trainLoad != undefined) { this.trainLoad = data.trainLoad; } + if ("maxSpeed" in data && data.maxSpeed != undefined) { + this.maxSpeed = data.maxSpeed; + } } } get davisParamA() { @@ -194,6 +198,12 @@ export namespace common { set trainLoad(value: number) { pb_1.Message.setField(this, 19, value); } + get maxSpeed() { + return pb_1.Message.getFieldWithDefault(this, 20, 0) as number; + } + set maxSpeed(value: number) { + pb_1.Message.setField(this, 20, value); + } static fromObject(data: { davisParamA?: number; davisParamB?: number; @@ -213,6 +223,7 @@ export namespace common { stopSign?: number; slide?: number; trainLoad?: number; + maxSpeed?: number; }): TrainDynamicConfig { const message = new TrainDynamicConfig({}); if (data.davisParamA != null) { @@ -269,6 +280,9 @@ export namespace common { if (data.trainLoad != null) { message.trainLoad = data.trainLoad; } + if (data.maxSpeed != null) { + message.maxSpeed = data.maxSpeed; + } return message; } toObject() { @@ -291,6 +305,7 @@ export namespace common { stopSign?: number; slide?: number; trainLoad?: number; + maxSpeed?: number; } = {}; if (this.davisParamA != null) { data.davisParamA = this.davisParamA; @@ -346,6 +361,9 @@ export namespace common { if (this.trainLoad != null) { data.trainLoad = this.trainLoad; } + if (this.maxSpeed != null) { + data.maxSpeed = this.maxSpeed; + } return data; } serialize(): Uint8Array; @@ -388,6 +406,8 @@ export namespace common { writer.writeFloat(18, this.slide); if (this.trainLoad != 0) writer.writeInt32(19, this.trainLoad); + if (this.maxSpeed != 0) + writer.writeFloat(20, this.maxSpeed); if (!w) return writer.getResultBuffer(); } @@ -451,6 +471,9 @@ export namespace common { case 19: message.trainLoad = reader.readInt32(); break; + case 20: + message.maxSpeed = reader.readFloat(); + break; default: reader.skipField(); } } diff --git a/src/protos/device_state.ts b/src/protos/device_state.ts index a491e92..5c3c44c 100644 --- a/src/protos/device_state.ts +++ b/src/protos/device_state.ts @@ -3388,6 +3388,8 @@ export namespace state { lightDir2?: boolean; lightDriverActive?: boolean; trainConnInitComplate?: boolean; + atoCloseRightDoor?: boolean; + lightAtoSend?: boolean; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); @@ -3626,6 +3628,12 @@ export namespace state { if ("trainConnInitComplate" in data && data.trainConnInitComplate != undefined) { this.trainConnInitComplate = data.trainConnInitComplate; } + if ("atoCloseRightDoor" in data && data.atoCloseRightDoor != undefined) { + this.atoCloseRightDoor = data.atoCloseRightDoor; + } + if ("lightAtoSend" in data && data.lightAtoSend != undefined) { + this.lightAtoSend = data.lightAtoSend; + } } } get lifeSignal() { @@ -4096,6 +4104,18 @@ export namespace state { set trainConnInitComplate(value: boolean) { pb_1.Message.setField(this, 82, value); } + get atoCloseRightDoor() { + return pb_1.Message.getFieldWithDefault(this, 83, false) as boolean; + } + set atoCloseRightDoor(value: boolean) { + pb_1.Message.setField(this, 83, value); + } + get lightAtoSend() { + return pb_1.Message.getFieldWithDefault(this, 84, false) as boolean; + } + set lightAtoSend(value: boolean) { + pb_1.Message.setField(this, 84, value); + } static fromObject(data: { lifeSignal?: number; tc1Active?: boolean; @@ -4175,6 +4195,8 @@ export namespace state { lightDir2?: boolean; lightDriverActive?: boolean; trainConnInitComplate?: boolean; + atoCloseRightDoor?: boolean; + lightAtoSend?: boolean; }): TrainVobcState { const message = new TrainVobcState({}); if (data.lifeSignal != null) { @@ -4411,6 +4433,12 @@ export namespace state { if (data.trainConnInitComplate != null) { message.trainConnInitComplate = data.trainConnInitComplate; } + if (data.atoCloseRightDoor != null) { + message.atoCloseRightDoor = data.atoCloseRightDoor; + } + if (data.lightAtoSend != null) { + message.lightAtoSend = data.lightAtoSend; + } return message; } toObject() { @@ -4493,6 +4521,8 @@ export namespace state { lightDir2?: boolean; lightDriverActive?: boolean; trainConnInitComplate?: boolean; + atoCloseRightDoor?: boolean; + lightAtoSend?: boolean; } = {}; if (this.lifeSignal != null) { data.lifeSignal = this.lifeSignal; @@ -4728,6 +4758,12 @@ export namespace state { if (this.trainConnInitComplate != null) { data.trainConnInitComplate = this.trainConnInitComplate; } + if (this.atoCloseRightDoor != null) { + data.atoCloseRightDoor = this.atoCloseRightDoor; + } + if (this.lightAtoSend != null) { + data.lightAtoSend = this.lightAtoSend; + } return data; } serialize(): Uint8Array; @@ -4890,6 +4926,10 @@ export namespace state { writer.writeBool(81, this.lightDriverActive); if (this.trainConnInitComplate != false) writer.writeBool(82, this.trainConnInitComplate); + if (this.atoCloseRightDoor != false) + writer.writeBool(83, this.atoCloseRightDoor); + if (this.lightAtoSend != false) + writer.writeBool(84, this.lightAtoSend); if (!w) return writer.getResultBuffer(); } @@ -5133,6 +5173,12 @@ export namespace state { case 82: message.trainConnInitComplate = reader.readBool(); break; + case 83: + message.atoCloseRightDoor = reader.readBool(); + break; + case 84: + message.lightAtoSend = reader.readBool(); + break; default: reader.skipField(); } } From f61ee0610ccb6b84a3786e8a68f411d588dbc0a9 Mon Sep 17 00:00:00 2001 From: fan Date: Thu, 29 Aug 2024 16:55:59 +0800 Subject: [PATCH 4/6] =?UTF-8?q?proto=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rts-sim-testing-message | 2 +- src/protos/common_data.ts | 46 --------------- src/protos/stationLayoutGraphics.ts | 92 +++++++++++++++++++++++++++++ 3 files changed, 93 insertions(+), 47 deletions(-) diff --git a/rts-sim-testing-message b/rts-sim-testing-message index 67d7d79..4e34593 160000 --- a/rts-sim-testing-message +++ b/rts-sim-testing-message @@ -1 +1 @@ -Subproject commit 67d7d79c5a50880b61be05d98184209422f15f1b +Subproject commit 4e345938106b1967c6b8b70db04d2d8933074611 diff --git a/src/protos/common_data.ts b/src/protos/common_data.ts index f1f5c9d..eabf075 100644 --- a/src/protos/common_data.ts +++ b/src/protos/common_data.ts @@ -25,8 +25,6 @@ export namespace common { idlingD?: number; stopSign?: number; slide?: number; - trainLoad?: number; - maxSpeed?: number; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); @@ -82,12 +80,6 @@ export namespace common { if ("slide" in data && data.slide != undefined) { this.slide = data.slide; } - if ("trainLoad" in data && data.trainLoad != undefined) { - this.trainLoad = data.trainLoad; - } - if ("maxSpeed" in data && data.maxSpeed != undefined) { - this.maxSpeed = data.maxSpeed; - } } } get davisParamA() { @@ -192,18 +184,6 @@ export namespace common { set slide(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 maxSpeed() { - return pb_1.Message.getFieldWithDefault(this, 20, 0) as number; - } - set maxSpeed(value: number) { - pb_1.Message.setField(this, 20, value); - } static fromObject(data: { davisParamA?: number; davisParamB?: number; @@ -222,8 +202,6 @@ export namespace common { idlingD?: number; stopSign?: number; slide?: number; - trainLoad?: number; - maxSpeed?: number; }): TrainDynamicConfig { const message = new TrainDynamicConfig({}); if (data.davisParamA != null) { @@ -277,12 +255,6 @@ export namespace common { if (data.slide != null) { message.slide = data.slide; } - if (data.trainLoad != null) { - message.trainLoad = data.trainLoad; - } - if (data.maxSpeed != null) { - message.maxSpeed = data.maxSpeed; - } return message; } toObject() { @@ -304,8 +276,6 @@ export namespace common { idlingD?: number; stopSign?: number; slide?: number; - trainLoad?: number; - maxSpeed?: number; } = {}; if (this.davisParamA != null) { data.davisParamA = this.davisParamA; @@ -358,12 +328,6 @@ export namespace common { if (this.slide != null) { data.slide = this.slide; } - if (this.trainLoad != null) { - data.trainLoad = this.trainLoad; - } - if (this.maxSpeed != null) { - data.maxSpeed = this.maxSpeed; - } return data; } serialize(): Uint8Array; @@ -404,10 +368,6 @@ export namespace common { writer.writeInt32(17, this.stopSign); if (this.slide != 0) writer.writeFloat(18, this.slide); - if (this.trainLoad != 0) - writer.writeInt32(19, this.trainLoad); - if (this.maxSpeed != 0) - writer.writeFloat(20, this.maxSpeed); if (!w) return writer.getResultBuffer(); } @@ -468,12 +428,6 @@ export namespace common { case 18: message.slide = reader.readFloat(); break; - case 19: - message.trainLoad = reader.readInt32(); - break; - case 20: - message.maxSpeed = reader.readFloat(); - break; default: reader.skipField(); } } diff --git a/src/protos/stationLayoutGraphics.ts b/src/protos/stationLayoutGraphics.ts index 38af44f..c95b09b 100644 --- a/src/protos/stationLayoutGraphics.ts +++ b/src/protos/stationLayoutGraphics.ts @@ -9084,6 +9084,10 @@ export namespace graphicData { trainSets?: string; dynamicConfig?: dependency_1.common.TrainDynamicConfig; trainControlMapId?: number; + trainLoad?: number; + trainMaxSpeed?: number; + trainMaxAcc?: number; + trainMaxBrake?: number; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); @@ -9106,6 +9110,18 @@ export namespace graphicData { if ("trainControlMapId" in data && data.trainControlMapId != undefined) { this.trainControlMapId = data.trainControlMapId; } + 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; + } } } get trainModel() { @@ -9147,6 +9163,30 @@ export namespace graphicData { set trainControlMapId(value: number) { pb_1.Message.setField(this, 9, value); } + get trainLoad() { + return pb_1.Message.getFieldWithDefault(this, 10, 0) as number; + } + set trainLoad(value: number) { + pb_1.Message.setField(this, 10, value); + } + get trainMaxSpeed() { + return pb_1.Message.getFieldWithDefault(this, 11, 0) as number; + } + set trainMaxSpeed(value: number) { + pb_1.Message.setField(this, 11, value); + } + get trainMaxAcc() { + return pb_1.Message.getFieldWithDefault(this, 12, 0) as number; + } + set trainMaxAcc(value: number) { + pb_1.Message.setField(this, 12, value); + } + get trainMaxBrake() { + return pb_1.Message.getFieldWithDefault(this, 13, 0) as number; + } + set trainMaxBrake(value: number) { + pb_1.Message.setField(this, 13, value); + } static fromObject(data: { trainModel?: Train.TrainModel; carriageLength?: number; @@ -9154,6 +9194,10 @@ export namespace graphicData { trainSets?: string; dynamicConfig?: ReturnType; trainControlMapId?: number; + trainLoad?: number; + trainMaxSpeed?: number; + trainMaxAcc?: number; + trainMaxBrake?: number; }): Train { const message = new Train({}); if (data.trainModel != null) { @@ -9174,6 +9218,18 @@ export namespace graphicData { if (data.trainControlMapId != null) { message.trainControlMapId = data.trainControlMapId; } + 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; + } return message; } toObject() { @@ -9184,6 +9240,10 @@ export namespace graphicData { trainSets?: string; dynamicConfig?: ReturnType; trainControlMapId?: number; + trainLoad?: number; + trainMaxSpeed?: number; + trainMaxAcc?: number; + trainMaxBrake?: number; } = {}; if (this.trainModel != null) { data.trainModel = this.trainModel; @@ -9203,6 +9263,18 @@ export namespace graphicData { if (this.trainControlMapId != null) { data.trainControlMapId = this.trainControlMapId; } + 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; + } return data; } serialize(): Uint8Array; @@ -9221,6 +9293,14 @@ export namespace graphicData { writer.writeMessage(7, this.dynamicConfig, () => this.dynamicConfig.serialize(writer)); if (this.trainControlMapId != 0) writer.writeInt32(9, this.trainControlMapId); + if (this.trainLoad != 0) + writer.writeInt32(10, this.trainLoad); + if (this.trainMaxSpeed != 0) + writer.writeFloat(11, this.trainMaxSpeed); + if (this.trainMaxAcc != 0) + writer.writeFloat(12, this.trainMaxAcc); + if (this.trainMaxBrake != 0) + writer.writeFloat(13, this.trainMaxBrake); if (!w) return writer.getResultBuffer(); } @@ -9248,6 +9328,18 @@ export namespace graphicData { case 9: message.trainControlMapId = reader.readInt32(); break; + case 10: + message.trainLoad = reader.readInt32(); + break; + case 11: + message.trainMaxSpeed = reader.readFloat(); + break; + case 12: + message.trainMaxAcc = reader.readFloat(); + break; + case 13: + message.trainMaxBrake = reader.readFloat(); + break; default: reader.skipField(); } } From e39774e4bcb9a775ef42ddb2cbeecb9313786560 Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Thu, 29 Aug 2024 17:27:47 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E9=A9=BE=E9=A9=B6=E5=8F=B0=E6=89=8B?= =?UTF-8?q?=E6=9F=840=E4=BD=8D=E8=8C=83=E5=9B=B4=E6=89=A9=E5=A4=A7?= =?UTF-8?q?=EF=BC=8C=E5=9C=A8=E8=8C=83=E5=9B=B4=E5=86=85=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=90=B8=E9=99=84=E5=88=B00=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/graphics/tccHandle/TccHandle.ts | 10 +++++++++- src/stores/tcc-store.ts | 15 +++++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/graphics/tccHandle/TccHandle.ts b/src/graphics/tccHandle/TccHandle.ts index 9a9ee93..03330fd 100644 --- a/src/graphics/tccHandle/TccHandle.ts +++ b/src/graphics/tccHandle/TccHandle.ts @@ -9,6 +9,7 @@ import Tcc_Handle_JSON from './tcc-handle-data.json'; import { Assets, Sprite, Spritesheet, Texture } from 'pixi.js'; +export const zeroOffset = 9; interface TccHandleTextures { tccHandle: Texture; handleBackground: Texture; @@ -54,7 +55,14 @@ export class TccHandle extends JlGraphic { return this.getStates(); } doRepaint(): void { - this._tccHandle.y = -(this.state.gear * 144) / 100; + const pos = -(this.state.gear * (144 - zeroOffset)) / 100; + if (pos > 0) { + this._tccHandle.y = pos + zeroOffset; + } else if (pos < 0) { + this._tccHandle.y = pos - zeroOffset; + } else { + this._tccHandle.y = 0; + } this._tccHandle.texture = this.tccHandleTextures.tccHandle; } } diff --git a/src/stores/tcc-store.ts b/src/stores/tcc-store.ts index 9bbbab9..3b85023 100644 --- a/src/stores/tcc-store.ts +++ b/src/stores/tcc-store.ts @@ -5,7 +5,7 @@ import { useLineStore } from './line-store'; import { tccOperation } from 'src/api/Simulation'; import { errorNotify } from 'src/utils/CommonNotify'; import { request } from 'src/protos/request'; -import { TccHandle } from 'src/graphics/tccHandle/TccHandle'; +import { TccHandle, zeroOffset } from 'src/graphics/tccHandle/TccHandle'; import { TccKey } from 'src/graphics/tccKey/TccKey'; import { IGraphicApp } from 'jl-graphic'; @@ -47,8 +47,19 @@ export const useTccStore = defineStore('tcc', { .getScene(`tcc${this.tccId}`) .queryStore.queryById(this.tccHandleId); if (!simulationId) return; + let transFormHandleVal = 0; + if ( + tccHandle._tccHandle.y >= -zeroOffset && + tccHandle._tccHandle.y <= zeroOffset + ) { + tccHandle._tccHandle.y = 0; + } else if (tccHandle._tccHandle.y < -zeroOffset) { + transFormHandleVal = tccHandle._tccHandle.y + zeroOffset; + } else { + transFormHandleVal = tccHandle._tccHandle.y - zeroOffset; + } const handleVal = Number( - (-(tccHandle._tccHandle.y / 144) * 100).toFixed() + (-(transFormHandleVal / (144 - zeroOffset)) * 100).toFixed() ); tccOperation({ simulationId, From 0db11ff3da71f0ef95cc6c7476eb943c7b57991c Mon Sep 17 00:00:00 2001 From: joylink_fanyuhong <18706759286@163.com> Date: Thu, 29 Aug 2024 17:40:35 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E5=88=97=E8=BD=A6=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=9F=BA=E6=9C=AC=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rts-sim-testing-message | 2 +- src/api/Simulation.ts | 1 - src/api/TrainModelApi.ts | 5 +- .../draw-app/dialogs/AddTrainDialog.vue | 8 +++ .../draw-app/dialogs/SetTrainParam.vue | 10 --- src/pages/TrainModelManage.vue | 66 ++++++++++++++++--- 6 files changed, 71 insertions(+), 21 deletions(-) diff --git a/rts-sim-testing-message b/rts-sim-testing-message index 4e34593..67d7d79 160000 --- a/rts-sim-testing-message +++ b/rts-sim-testing-message @@ -1 +1 @@ -Subproject commit 4e345938106b1967c6b8b70db04d2d8933074611 +Subproject commit 67d7d79c5a50880b61be05d98184209422f15f1b diff --git a/src/api/Simulation.ts b/src/api/Simulation.ts index 26b250b..819ecc3 100644 --- a/src/api/Simulation.ts +++ b/src/api/Simulation.ts @@ -390,7 +390,6 @@ export interface TrainConfig { idlingA: number; idlingR: number; idlingD: number; - trainLoad?: number; }; trainEndsA: { radarCheckSpeedDiff: number; diff --git a/src/api/TrainModelApi.ts b/src/api/TrainModelApi.ts index ff181dd..78f3607 100644 --- a/src/api/TrainModelApi.ts +++ b/src/api/TrainModelApi.ts @@ -45,7 +45,6 @@ export interface TrainConfigData { idlingA: number; idlingR: number; idlingD: number; - trainLoad?: number; } export interface TrainCreateParams { @@ -57,6 +56,10 @@ export interface TrainCreateParams { total_length: number; train_model: number; train_sets: string; + train_load: number; + train_max_speed: number; + train_max_acc: number; + train_max_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 a10546f..9b085dd 100644 --- a/src/components/draw-app/dialogs/AddTrainDialog.vue +++ b/src/components/draw-app/dialogs/AddTrainDialog.vue @@ -171,6 +171,10 @@ function onCreate() { trainSpeed: trainSpeed.value, wheelDiameter: wheelDiameter.value, trainLength: trainConfig.value.total_length, + trainLoad: trainConfig.value.train_load, + trianMaxSpeed: trainConfig.value.train_max_speed, + trainMaxAcc: trainConfig.value.train_max_acc, + trianMaxBrake: trainConfig.value.train_max_brake, configTrain: trainConfig.value.trainConfigData as TrainConfigData, trainControlMapId: trainConfig.value.trainControlMapId, trainEndsA: { @@ -218,6 +222,10 @@ const trainConfig = ref({ total_length: 0, train_model: 0, train_sets: '', + train_load: 0, + train_max_speed: 0, + train_max_acc: 0, + train_max_brake: 0, trainControlMapId: 0, }); function setConfigVal(val: TrainConfigItem | null) { diff --git a/src/components/draw-app/dialogs/SetTrainParam.vue b/src/components/draw-app/dialogs/SetTrainParam.vue index e875ebd..ba8e4fd 100644 --- a/src/components/draw-app/dialogs/SetTrainParam.vue +++ b/src/components/draw-app/dialogs/SetTrainParam.vue @@ -328,14 +328,6 @@ hint="" /> -
- -
@@ -521,7 +513,6 @@ const model = reactive({ idlingA: 0, idlingR: 0, idlingD: 0, - trainLoad: 0, }, length: 0, wheelDiameter: 0, @@ -582,7 +573,6 @@ function initModel() { idlingA: trainState.idlingA, idlingR: trainState.idlingR, idlingD: trainState.idlingD, - trainLoad: trainState.trainLoad, }; model.length = trainState.trainLength; model.wheelDiameter = trainState.wheelDiameter; diff --git a/src/pages/TrainModelManage.vue b/src/pages/TrainModelManage.vue index c4c48d7..8382104 100644 --- a/src/pages/TrainModelManage.vue +++ b/src/pages/TrainModelManage.vue @@ -166,6 +166,38 @@ label="关联驾驶台地图" /> +
+ +
+
+ +
+
+ +
+
+ +
-
@@ -535,6 +569,10 @@ function onCreate() { // min_diameter: editInfo.min_diameter, // max_diameter: editInfo.max_diameter, train_sets: editInfo.train_sets, + train_load: editInfo.train_load, + train_max_speed: editInfo.train_max_speed, + train_max_acc: editInfo.train_max_acc, + train_max_brake: editInfo.train_max_brake, trainConfigData: editInfo.trainConfigData, trainControlMapId: editInfo.trainControlMapId, }; @@ -566,6 +604,10 @@ function onReset() { editInfo.train_model = 0; editInfo.carriage_length = 0; editInfo.total_length = 0; + editInfo.train_load = 0; + editInfo.train_max_speed = 0; + editInfo.train_max_acc = 0; + editInfo.train_max_brake = 0; // editInfo.min_diameter = 0; // editInfo.max_diameter = 0; editInfo.train_sets = ''; @@ -587,7 +629,6 @@ function onReset() { editInfo.trainConfigData.idlingA = 0; editInfo.trainConfigData.idlingR = 0; editInfo.trainConfigData.idlingD = 0; - editInfo.trainConfigData.trainLoad = 0; createForm.value?.resetValidation(); } @@ -625,6 +666,10 @@ interface EditCreateItem extends TrainCreateParams { total_length: number; train_model: number; train_sets: string; + train_load: number; + train_max_speed: number; + train_max_acc: number; + train_max_brake: number; trainControlMapId: number; trainConfigData: { davisParamA: number; @@ -644,7 +689,6 @@ interface EditCreateItem extends TrainCreateParams { idlingA: number; idlingR: number; idlingD: number; - trainLoad: number; }; } @@ -658,6 +702,10 @@ const editInfo = reactive({ min_diameter: 0, max_diameter: 0, train_sets: '', + train_load: 0, + train_max_speed: 0, + train_max_acc: 0, + train_max_brake: 0, trainControlMapId: 0, trainConfigData: { davisParamA: 2.25, @@ -677,7 +725,6 @@ const editInfo = reactive({ idlingA: 0, idlingR: 0, idlingD: 0, - trainLoad: 0, }, }); function editData(row: TrainItem) { @@ -689,6 +736,10 @@ function editData(row: TrainItem) { editInfo.train_model = res.train_model; editInfo.carriage_length = res.carriage_length; editInfo.total_length = res.total_length; + editInfo.train_load = res.train_load; + 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.min_diameter = res.min_diameter; // editInfo.max_diameter = res.max_diameter; editInfo.train_sets = res.train_sets; @@ -716,7 +767,6 @@ function editData(row: TrainItem) { editInfo.trainConfigData.idlingA = res.trainConfigData.idlingA; editInfo.trainConfigData.idlingR = res.trainConfigData.idlingR; editInfo.trainConfigData.idlingD = res.trainConfigData.idlingD; - editInfo.trainConfigData.trainLoad = res.trainConfigData.trainLoad || 0; } createFormShow.value = true; })