diff --git a/api/simulation.go b/api/simulation.go index 21478d3..bd540a6 100644 --- a/api/simulation.go +++ b/api/simulation.go @@ -28,6 +28,7 @@ func InitSimulationRouter(api *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddle authed.GET("/list", findAllSimulations) authed.POST("/check/data", checkSimMapData) authed.POST("/train/add", addTrain) + authed.POST("/train/config", configTrain) authed.POST("/train/remove", removeTrain) authed.POST("/train/update", updateTrain) authed.POST("/switch/operation", turnoutOperation) @@ -174,6 +175,32 @@ func checkSimMapData(c *gin.Context) { c.JSON(http.StatusOK, &dto.CheckMapDataRspDto{Success: true}) } +// 列车动力学参数配置修改 +// +// @Summary 列车动力学参数配置修改 +// +// @Security JwtAuth +// +// @Description 地图数据校验 +// @Tags ATS测试仿真Api +// @Accept json +// @Produce json +// @Param Authorization header string true "JWT Token" +// @Param RemoveTrainDto body dto.ConfigTrainReqDto true "动力学参数配置" +// +// @Success 200 {object} string +// @Failure 500 {object} dto.ErrorDto +// @Router /api/v1/simulation/train/config [post] +func configTrain(c *gin.Context) { + req := &dto.ConfigTrainReqDto{} + if err := c.ShouldBind(&req); err != nil { + panic(sys_error.New("修改列车配置失败,请求参数异常", err)) + } + simulation := checkDeviceDataAndReturn(req.SimulationId) + memory.UpdateConfigTrain(simulation, req) + c.JSON(http.StatusOK, "ok") +} + // ATS测试仿真-添加列车 // // @Summary ATS测试仿真-添加列车 diff --git a/docs/docs.go b/docs/docs.go index ad7cde0..d8ccdba 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -1,5 +1,4 @@ -// Code generated by swaggo/swag. DO NOT EDIT. - +// Package docs Code generated by swaggo/swag. DO NOT EDIT package docs import "github.com/swaggo/swag" @@ -4186,6 +4185,58 @@ const docTemplate = `{ } } }, + "/api/v1/simulation/train/config": { + "post": { + "security": [ + { + "JwtAuth": [] + } + ], + "description": "地图数据校验", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ATS测试仿真Api" + ], + "summary": "列车动力学参数配置修改", + "parameters": [ + { + "type": "string", + "description": "JWT Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "动力学参数配置", + "name": "RemoveTrainDto", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ConfigTrainReqDto" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/dto.ErrorDto" + } + } + } + } + }, "/api/v1/simulation/train/remove": { "post": { "security": [ @@ -4903,6 +4954,55 @@ const docTemplate = `{ } }, "definitions": { + "data_proto.KilometerSystem": { + "type": "object", + "properties": { + "coordinateSystem": { + "description": "坐标系", + "type": "string" + }, + "direction": { + "description": "左右行", + "allOf": [ + { + "$ref": "#/definitions/data_proto.KilometerSystem_Direction" + } + ] + }, + "kilometer": { + "description": "公里标mm", + "type": "integer" + } + } + }, + "data_proto.KilometerSystem_Direction": { + "type": "integer", + "enum": [ + 0, + 1 + ], + "x-enum-varnames": [ + "KilometerSystem_LEFT", + "KilometerSystem_RIGHT" + ] + }, + "data_proto.PictureType": { + "type": "integer", + "enum": [ + 0, + 1, + 2, + 3, + 4 + ], + "x-enum-varnames": [ + "PictureType_StationLayout", + "PictureType_Psl", + "PictureType_RelayCabinetLayout", + "PictureType_IBP", + "PictureType_TrainData" + ] + }, "dto.AddTrainReqDto": { "type": "object", "properties": { @@ -5037,10 +5137,8 @@ const docTemplate = `{ "type": "string" }, "telegram": { - "type": "array", - "items": { - "type": "integer" - } + "description": "报文(16进制字符串)", + "type": "string" } } }, @@ -5055,7 +5153,7 @@ const docTemplate = `{ "description": "公里标", "allOf": [ { - "$ref": "#/definitions/graphicData.KilometerSystem" + "$ref": "#/definitions/data_proto.KilometerSystem" } ] }, @@ -5114,6 +5212,98 @@ const docTemplate = `{ } } }, + "dto.ConfigTrainData": { + "type": "object", + "properties": { + "baseResistanceParamA": { + "description": "基本阻力参数A", + "type": "number" + }, + "baseResistanceParamB": { + "description": "基本阻力参数B", + "type": "number" + }, + "baseResistanceParamC": { + "description": "基本阻力参数C", + "type": "number" + }, + "curveResistanceParamR1": { + "description": "曲线阻力参数R1", + "type": "number" + }, + "curveResistanceParamR2": { + "description": "曲线阻力参数R2", + "type": "number" + }, + "curveResistanceParamR3": { + "description": "曲线阻力参数R3", + "type": "number" + }, + "curveResistanceParamR4": { + "description": "曲线阻力参数R4", + "type": "number" + }, + "jump": { + "description": "是否跳跃", + "type": "boolean" + }, + "length": { + "description": "列车的长度(cm)", + "type": "integer" + }, + "mass": { + "description": "列车的质量(100=1ton)", + "type": "integer" + }, + "radarCheckSpeed": { + "description": "雷达测速数值", + "type": "number" + }, + "radarCheckTime": { + "description": "雷达检测时间(秒)", + "type": "integer" + }, + "radarEnable": { + "description": "雷达是否有效", + "type": "boolean" + }, + "revolvingMassParam": { + "description": "旋转质量参数", + "type": "number" + }, + "slide": { + "description": "前溜/后溜(mm)(正数前溜,负数后溜)", + "type": "integer" + }, + "slip": { + "description": "打滑(%)", + "type": "number" + }, + "stopSign": { + "description": "过标/欠标(mm)(正数过标,负数欠标)", + "type": "integer" + }, + "wheelDiameter": { + "description": "轮径(mm)", + "type": "integer" + } + } + }, + "dto.ConfigTrainReqDto": { + "type": "object", + "properties": { + "TrainId": { + "description": "列车Id", + "type": "integer" + }, + "configData": { + "$ref": "#/definitions/dto.ConfigTrainData" + }, + "simulationId": { + "type": "string" + } + } + }, "dto.ErrorDto": { "type": "object", "properties": { @@ -5487,7 +5677,7 @@ const docTemplate = `{ "description": "当操作为Operation.Display时有效,表示显示的信号", "allOf": [ { - "$ref": "#/definitions/state.Signal_Aspect" + "$ref": "#/definitions/state_proto.Signal_Aspect" } ] }, @@ -5680,55 +5870,6 @@ const docTemplate = `{ } } }, - "graphicData.KilometerSystem": { - "type": "object", - "properties": { - "coordinateSystem": { - "description": "坐标系", - "type": "string" - }, - "direction": { - "description": "左右行", - "allOf": [ - { - "$ref": "#/definitions/graphicData.KilometerSystem_Direction" - } - ] - }, - "kilometer": { - "description": "公里标mm", - "type": "integer" - } - } - }, - "graphicData.KilometerSystem_Direction": { - "type": "integer", - "enum": [ - 0, - 1 - ], - "x-enum-varnames": [ - "KilometerSystem_LEFT", - "KilometerSystem_RIGHT" - ] - }, - "graphicData.PictureType": { - "type": "integer", - "enum": [ - 0, - 1, - 2, - 3, - 4 - ], - "x-enum-varnames": [ - "PictureType_StationLayout", - "PictureType_Psl", - "PictureType_RelayCabinetLayout", - "PictureType_IBP", - "PictureType_TrainData" - ] - }, "model.AuthAPIPath": { "type": "object", "properties": { @@ -6107,7 +6248,7 @@ const docTemplate = `{ "Turnout_CancelForce" ] }, - "state.Signal_Aspect": { + "state_proto.Signal_Aspect": { "type": "integer", "enum": [ 0, diff --git a/docs/swagger.json b/docs/swagger.json index a9845d4..98c3595 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -4179,6 +4179,58 @@ } } }, + "/api/v1/simulation/train/config": { + "post": { + "security": [ + { + "JwtAuth": [] + } + ], + "description": "地图数据校验", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ATS测试仿真Api" + ], + "summary": "列车动力学参数配置修改", + "parameters": [ + { + "type": "string", + "description": "JWT Token", + "name": "Authorization", + "in": "header", + "required": true + }, + { + "description": "动力学参数配置", + "name": "RemoveTrainDto", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ConfigTrainReqDto" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/dto.ErrorDto" + } + } + } + } + }, "/api/v1/simulation/train/remove": { "post": { "security": [ @@ -4896,6 +4948,55 @@ } }, "definitions": { + "data_proto.KilometerSystem": { + "type": "object", + "properties": { + "coordinateSystem": { + "description": "坐标系", + "type": "string" + }, + "direction": { + "description": "左右行", + "allOf": [ + { + "$ref": "#/definitions/data_proto.KilometerSystem_Direction" + } + ] + }, + "kilometer": { + "description": "公里标mm", + "type": "integer" + } + } + }, + "data_proto.KilometerSystem_Direction": { + "type": "integer", + "enum": [ + 0, + 1 + ], + "x-enum-varnames": [ + "KilometerSystem_LEFT", + "KilometerSystem_RIGHT" + ] + }, + "data_proto.PictureType": { + "type": "integer", + "enum": [ + 0, + 1, + 2, + 3, + 4 + ], + "x-enum-varnames": [ + "PictureType_StationLayout", + "PictureType_Psl", + "PictureType_RelayCabinetLayout", + "PictureType_IBP", + "PictureType_TrainData" + ] + }, "dto.AddTrainReqDto": { "type": "object", "properties": { @@ -5030,10 +5131,8 @@ "type": "string" }, "telegram": { - "type": "array", - "items": { - "type": "integer" - } + "description": "报文(16进制字符串)", + "type": "string" } } }, @@ -5048,7 +5147,7 @@ "description": "公里标", "allOf": [ { - "$ref": "#/definitions/graphicData.KilometerSystem" + "$ref": "#/definitions/data_proto.KilometerSystem" } ] }, @@ -5107,6 +5206,98 @@ } } }, + "dto.ConfigTrainData": { + "type": "object", + "properties": { + "baseResistanceParamA": { + "description": "基本阻力参数A", + "type": "number" + }, + "baseResistanceParamB": { + "description": "基本阻力参数B", + "type": "number" + }, + "baseResistanceParamC": { + "description": "基本阻力参数C", + "type": "number" + }, + "curveResistanceParamR1": { + "description": "曲线阻力参数R1", + "type": "number" + }, + "curveResistanceParamR2": { + "description": "曲线阻力参数R2", + "type": "number" + }, + "curveResistanceParamR3": { + "description": "曲线阻力参数R3", + "type": "number" + }, + "curveResistanceParamR4": { + "description": "曲线阻力参数R4", + "type": "number" + }, + "jump": { + "description": "是否跳跃", + "type": "boolean" + }, + "length": { + "description": "列车的长度(cm)", + "type": "integer" + }, + "mass": { + "description": "列车的质量(100=1ton)", + "type": "integer" + }, + "radarCheckSpeed": { + "description": "雷达测速数值", + "type": "number" + }, + "radarCheckTime": { + "description": "雷达检测时间(秒)", + "type": "integer" + }, + "radarEnable": { + "description": "雷达是否有效", + "type": "boolean" + }, + "revolvingMassParam": { + "description": "旋转质量参数", + "type": "number" + }, + "slide": { + "description": "前溜/后溜(mm)(正数前溜,负数后溜)", + "type": "integer" + }, + "slip": { + "description": "打滑(%)", + "type": "number" + }, + "stopSign": { + "description": "过标/欠标(mm)(正数过标,负数欠标)", + "type": "integer" + }, + "wheelDiameter": { + "description": "轮径(mm)", + "type": "integer" + } + } + }, + "dto.ConfigTrainReqDto": { + "type": "object", + "properties": { + "TrainId": { + "description": "列车Id", + "type": "integer" + }, + "configData": { + "$ref": "#/definitions/dto.ConfigTrainData" + }, + "simulationId": { + "type": "string" + } + } + }, "dto.ErrorDto": { "type": "object", "properties": { @@ -5480,7 +5671,7 @@ "description": "当操作为Operation.Display时有效,表示显示的信号", "allOf": [ { - "$ref": "#/definitions/state.Signal_Aspect" + "$ref": "#/definitions/state_proto.Signal_Aspect" } ] }, @@ -5673,55 +5864,6 @@ } } }, - "graphicData.KilometerSystem": { - "type": "object", - "properties": { - "coordinateSystem": { - "description": "坐标系", - "type": "string" - }, - "direction": { - "description": "左右行", - "allOf": [ - { - "$ref": "#/definitions/graphicData.KilometerSystem_Direction" - } - ] - }, - "kilometer": { - "description": "公里标mm", - "type": "integer" - } - } - }, - "graphicData.KilometerSystem_Direction": { - "type": "integer", - "enum": [ - 0, - 1 - ], - "x-enum-varnames": [ - "KilometerSystem_LEFT", - "KilometerSystem_RIGHT" - ] - }, - "graphicData.PictureType": { - "type": "integer", - "enum": [ - 0, - 1, - 2, - 3, - 4 - ], - "x-enum-varnames": [ - "PictureType_StationLayout", - "PictureType_Psl", - "PictureType_RelayCabinetLayout", - "PictureType_IBP", - "PictureType_TrainData" - ] - }, "model.AuthAPIPath": { "type": "object", "properties": { @@ -6100,7 +6242,7 @@ "Turnout_CancelForce" ] }, - "state.Signal_Aspect": { + "state_proto.Signal_Aspect": { "type": "integer", "enum": [ 0, diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 0e8c9dc..dd09bdd 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -1,5 +1,40 @@ basePath: / definitions: + data_proto.KilometerSystem: + properties: + coordinateSystem: + description: 坐标系 + type: string + direction: + allOf: + - $ref: '#/definitions/data_proto.KilometerSystem_Direction' + description: 左右行 + kilometer: + description: 公里标mm + type: integer + type: object + data_proto.KilometerSystem_Direction: + enum: + - 0 + - 1 + type: integer + x-enum-varnames: + - KilometerSystem_LEFT + - KilometerSystem_RIGHT + data_proto.PictureType: + enum: + - 0 + - 1 + - 2 + - 3 + - 4 + type: integer + x-enum-varnames: + - PictureType_StationLayout + - PictureType_Psl + - PictureType_RelayCabinetLayout + - PictureType_IBP + - PictureType_TrainData dto.AddTrainReqDto: properties: devicePort: @@ -94,9 +129,8 @@ definitions: description: 仿真ID type: string telegram: - items: - type: integer - type: array + description: 报文(16进制字符串) + type: string type: object dto.BaliseMoveReqDto: properties: @@ -105,7 +139,7 @@ definitions: type: integer km: allOf: - - $ref: '#/definitions/graphicData.KilometerSystem' + - $ref: '#/definitions/data_proto.KilometerSystem' description: 公里标 mapId: description: 地图ID @@ -144,6 +178,73 @@ definitions: success: type: boolean type: object + dto.ConfigTrainData: + properties: + baseResistanceParamA: + description: 基本阻力参数A + type: number + baseResistanceParamB: + description: 基本阻力参数B + type: number + baseResistanceParamC: + description: 基本阻力参数C + type: number + curveResistanceParamR1: + description: 曲线阻力参数R1 + type: number + curveResistanceParamR2: + description: 曲线阻力参数R2 + type: number + curveResistanceParamR3: + description: 曲线阻力参数R3 + type: number + curveResistanceParamR4: + description: 曲线阻力参数R4 + type: number + jump: + description: 是否跳跃 + type: boolean + length: + description: 列车的长度(cm) + type: integer + mass: + description: 列车的质量(100=1ton) + type: integer + radarCheckSpeed: + description: 雷达测速数值 + type: number + radarCheckTime: + description: 雷达检测时间(秒) + type: integer + radarEnable: + description: 雷达是否有效 + type: boolean + revolvingMassParam: + description: 旋转质量参数 + type: number + slide: + description: 前溜/后溜(mm)(正数前溜,负数后溜) + type: integer + slip: + description: 打滑(%) + type: number + stopSign: + description: 过标/欠标(mm)(正数过标,负数欠标) + type: integer + wheelDiameter: + description: 轮径(mm) + type: integer + type: object + dto.ConfigTrainReqDto: + properties: + TrainId: + description: 列车Id + type: integer + configData: + $ref: '#/definitions/dto.ConfigTrainData' + simulationId: + type: string + type: object dto.ErrorDto: properties: code: @@ -392,7 +493,7 @@ definitions: properties: aspect: allOf: - - $ref: '#/definitions/state.Signal_Aspect' + - $ref: '#/definitions/state_proto.Signal_Aspect' description: 当操作为Operation.Display时有效,表示显示的信号 id: type: integer @@ -528,41 +629,6 @@ definitions: $ref: '#/definitions/dto.AuthRoleRspDto' type: array type: object - graphicData.KilometerSystem: - properties: - coordinateSystem: - description: 坐标系 - type: string - direction: - allOf: - - $ref: '#/definitions/graphicData.KilometerSystem_Direction' - description: 左右行 - kilometer: - description: 公里标mm - type: integer - type: object - graphicData.KilometerSystem_Direction: - enum: - - 0 - - 1 - type: integer - x-enum-varnames: - - KilometerSystem_LEFT - - KilometerSystem_RIGHT - graphicData.PictureType: - enum: - - 0 - - 1 - - 2 - - 3 - - 4 - type: integer - x-enum-varnames: - - PictureType_StationLayout - - PictureType_Psl - - PictureType_RelayCabinetLayout - - PictureType_IBP - - PictureType_TrainData model.AuthAPIPath: properties: id: @@ -864,7 +930,7 @@ definitions: description: 仿真id type: string type: object - state.Signal_Aspect: + state_proto.Signal_Aspect: enum: - 0 - 1 @@ -3542,6 +3608,39 @@ paths: summary: ATS测试仿真-添加列车 tags: - ATS测试仿真Api + /api/v1/simulation/train/config: + post: + consumes: + - application/json + description: 地图数据校验 + parameters: + - description: JWT Token + in: header + name: Authorization + required: true + type: string + - description: 动力学参数配置 + in: body + name: RemoveTrainDto + required: true + schema: + $ref: '#/definitions/dto.ConfigTrainReqDto' + produces: + - application/json + responses: + "200": + description: OK + schema: + type: string + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/dto.ErrorDto' + security: + - JwtAuth: [] + summary: 列车动力学参数配置修改 + tags: + - ATS测试仿真Api /api/v1/simulation/train/remove: post: consumes: diff --git a/dto/data_proto/ibpGraphics.pb.go b/dto/data_proto/ibpGraphics.pb.go index 3776ce9..fad7e28 100644 --- a/dto/data_proto/ibpGraphics.pb.go +++ b/dto/data_proto/ibpGraphics.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.32.0 // protoc v4.23.1 // source: ibpGraphics.proto diff --git a/dto/data_proto/picture.pb.go b/dto/data_proto/picture.pb.go index 57791f4..020ae0f 100644 --- a/dto/data_proto/picture.pb.go +++ b/dto/data_proto/picture.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.32.0 // protoc v4.23.1 // source: picture.proto diff --git a/dto/data_proto/pslGraphics.pb.go b/dto/data_proto/pslGraphics.pb.go index 2e9bcbe..d45ff35 100644 --- a/dto/data_proto/pslGraphics.pb.go +++ b/dto/data_proto/pslGraphics.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.32.0 // protoc v4.23.1 // source: pslGraphics.proto diff --git a/dto/data_proto/relayCabinetLayoutGraphics.pb.go b/dto/data_proto/relayCabinetLayoutGraphics.pb.go index 15ae6fe..8e771cd 100644 --- a/dto/data_proto/relayCabinetLayoutGraphics.pb.go +++ b/dto/data_proto/relayCabinetLayoutGraphics.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.32.0 // protoc v4.23.1 // source: relayCabinetLayoutGraphics.proto diff --git a/dto/data_proto/stationLayoutGraphics.pb.go b/dto/data_proto/stationLayoutGraphics.pb.go index 916c6cb..900ee09 100644 --- a/dto/data_proto/stationLayoutGraphics.pb.go +++ b/dto/data_proto/stationLayoutGraphics.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.32.0 // protoc v4.23.1 // source: stationLayoutGraphics.proto diff --git a/dto/request_proto/request.pb.go b/dto/request_proto/request.pb.go index 6229611..3807c5e 100644 --- a/dto/request_proto/request.pb.go +++ b/dto/request_proto/request.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.32.0 // protoc v4.23.1 // source: request.proto diff --git a/dto/simulation.go b/dto/simulation.go index 8a06aed..98099cd 100644 --- a/dto/simulation.go +++ b/dto/simulation.go @@ -56,6 +56,36 @@ type AddTrainReqDto struct { WheelDiameter int32 `json:"wheelDiameter" from:"wheelDiameter"` } +// 为反正列车修改对应的测试配置 +type ConfigTrainReqDto struct { + SimulationId string `json:"simulationId" form:"simulationId"` + // 列车Id + TrainId int `json:"TrainId" form:"TrainId"` + ConfigData ConfigTrainData +} + +type ConfigTrainData struct { + // + Mass int32 `json:"mass" form:"mass"` // 列车的质量(100=1ton) + Length int64 `json:"length"` // 列车的长度(cm) + BaseResistanceParamA float32 `json:"baseResistanceParamA"` // 基本阻力参数A + BaseResistanceParamB float32 `json:"baseResistanceParamB"` // 基本阻力参数B + BaseResistanceParamC float32 `json:"baseResistanceParamC"` // 基本阻力参数C + CurveResistanceParamR1 float32 `json:"curveResistanceParamR1"` // 曲线阻力参数R1 + CurveResistanceParamR2 float32 `json:"curveResistanceParamR2"` // 曲线阻力参数R2 + CurveResistanceParamR3 float32 `json:"curveResistanceParamR3"` // 曲线阻力参数R3 + CurveResistanceParamR4 float32 `json:"curveResistanceParamR4"` // 曲线阻力参数R4 + RevolvingMassParam float32 `json:"revolvingMassParam"` // 旋转质量参数 + Jump bool `json:"jump"` // 是否跳跃 + Slip float32 `json:"slip"` // 打滑(%) + Slide int32 `json:"slide"` // 前溜/后溜(mm)(正数前溜,负数后溜) + StopSign int32 `json:"stopSign"` // 过标/欠标(mm)(正数过标,负数欠标) + WheelDiameter int32 `json:"wheelDiameter"` // 轮径(mm) + RadarEnable bool `json:"radarEnable"` // 雷达是否有效 + RadarCheckSpeed float32 `json:"radarCheckSpeed"` // 雷达测速数值 + RadarCheckTime int32 `json:"radarCheckTime"` // 雷达检测时间(秒) +} + // 为仿真添加测试车请求 type UpdateTrainReqDto struct { // 仿真id diff --git a/dto/state_proto/device_state.pb.go b/dto/state_proto/device_state.pb.go index d25b44e..88556fa 100644 --- a/dto/state_proto/device_state.pb.go +++ b/dto/state_proto/device_state.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.32.0 // protoc v4.23.1 // source: device_state.proto @@ -199,7 +199,7 @@ func (x SimulationStatus_SimulationState) Number() protoreflect.EnumNumber { // Deprecated: Use SimulationStatus_SimulationState.Descriptor instead. func (SimulationStatus_SimulationState) EnumDescriptor() ([]byte, []int) { - return file_device_state_proto_rawDescGZIP(), []int{23, 0} + return file_device_state_proto_rawDescGZIP(), []int{24, 0} } // 相邻端点定义的link的状态 @@ -977,7 +977,8 @@ type TrainDynamicState struct { // 通讯中断 UdpInterruption bool `protobuf:"varint,21,opt,name=udpInterruption,proto3" json:"udpInterruption,omitempty"` // 加速 - Acceleration float32 `protobuf:"fixed32,22,opt,name=acceleration,proto3" json:"acceleration,omitempty"` + Acceleration float32 `protobuf:"fixed32,22,opt,name=acceleration,proto3" json:"acceleration,omitempty"` + TrainDynamicConfig *TrainDynamicConfig `protobuf:"bytes,23,opt,name=trainDynamicConfig,proto3" json:"trainDynamicConfig,omitempty"` } func (x *TrainDynamicState) Reset() { @@ -1166,6 +1167,197 @@ func (x *TrainDynamicState) GetAcceleration() float32 { return 0 } +func (x *TrainDynamicState) GetTrainDynamicConfig() *TrainDynamicConfig { + if x != nil { + return x.TrainDynamicConfig + } + return nil +} + +// 动力学列车配置 +type TrainDynamicConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // 列车的质量(100=1ton) + Mass int32 `protobuf:"varint,1,opt,name=mass,proto3" json:"mass,omitempty"` + // 基本阻力参数A + BaseResistanceParamA float32 `protobuf:"fixed32,2,opt,name=baseResistanceParamA,proto3" json:"baseResistanceParamA,omitempty"` + // 基本阻力参数B + BaseResistanceParamB float32 `protobuf:"fixed32,3,opt,name=baseResistanceParamB,proto3" json:"baseResistanceParamB,omitempty"` + // 基本阻力参数C + BaseResistanceParamC float32 `protobuf:"fixed32,4,opt,name=baseResistanceParamC,proto3" json:"baseResistanceParamC,omitempty"` + // 曲线阻力参数R1 + CurveResistanceParamR1 float32 `protobuf:"fixed32,5,opt,name=curveResistanceParamR1,proto3" json:"curveResistanceParamR1,omitempty"` + // 曲线阻力参数R2 + CurveResistanceParamR2 float32 `protobuf:"fixed32,6,opt,name=curveResistanceParamR2,proto3" json:"curveResistanceParamR2,omitempty"` + // 曲线阻力参数R3 + CurveResistanceParamR3 float32 `protobuf:"fixed32,7,opt,name=curveResistanceParamR3,proto3" json:"curveResistanceParamR3,omitempty"` + // 曲线阻力参数R4 + CurveResistanceParamR4 float32 `protobuf:"fixed32,8,opt,name=curveResistanceParamR4,proto3" json:"curveResistanceParamR4,omitempty"` + // 旋转质量参数 + RevolvingMassParam float32 `protobuf:"fixed32,9,opt,name=revolvingMassParam,proto3" json:"revolvingMassParam,omitempty"` + // 是否跳跃 + Jump bool `protobuf:"varint,10,opt,name=jump,proto3" json:"jump,omitempty"` + // 打滑(%) + Slip float32 `protobuf:"fixed32,11,opt,name=slip,proto3" json:"slip,omitempty"` + // 前溜/后溜(mm)(正数前溜,负数后溜) + Slide int32 `protobuf:"varint,12,opt,name=slide,proto3" json:"slide,omitempty"` + // 过标/欠标(mm)(正数过标,负数欠标) + StopSign int32 `protobuf:"varint,13,opt,name=stopSign,proto3" json:"stopSign,omitempty"` + // 雷达是否有效 + RadarEnable bool `protobuf:"varint,14,opt,name=radarEnable,proto3" json:"radarEnable,omitempty"` + // 雷达测速数值 + RadarCheckSpeed float32 `protobuf:"fixed32,15,opt,name=radarCheckSpeed,proto3" json:"radarCheckSpeed,omitempty"` + // 雷达检测时间(秒) + RadarCheckTime int32 `protobuf:"varint,16,opt,name=radarCheckTime,proto3" json:"radarCheckTime,omitempty"` +} + +func (x *TrainDynamicConfig) Reset() { + *x = TrainDynamicConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_device_state_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TrainDynamicConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TrainDynamicConfig) ProtoMessage() {} + +func (x *TrainDynamicConfig) ProtoReflect() protoreflect.Message { + mi := &file_device_state_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TrainDynamicConfig.ProtoReflect.Descriptor instead. +func (*TrainDynamicConfig) Descriptor() ([]byte, []int) { + return file_device_state_proto_rawDescGZIP(), []int{9} +} + +func (x *TrainDynamicConfig) GetMass() int32 { + if x != nil { + return x.Mass + } + return 0 +} + +func (x *TrainDynamicConfig) GetBaseResistanceParamA() float32 { + if x != nil { + return x.BaseResistanceParamA + } + return 0 +} + +func (x *TrainDynamicConfig) GetBaseResistanceParamB() float32 { + if x != nil { + return x.BaseResistanceParamB + } + return 0 +} + +func (x *TrainDynamicConfig) GetBaseResistanceParamC() float32 { + if x != nil { + return x.BaseResistanceParamC + } + return 0 +} + +func (x *TrainDynamicConfig) GetCurveResistanceParamR1() float32 { + if x != nil { + return x.CurveResistanceParamR1 + } + return 0 +} + +func (x *TrainDynamicConfig) GetCurveResistanceParamR2() float32 { + if x != nil { + return x.CurveResistanceParamR2 + } + return 0 +} + +func (x *TrainDynamicConfig) GetCurveResistanceParamR3() float32 { + if x != nil { + return x.CurveResistanceParamR3 + } + return 0 +} + +func (x *TrainDynamicConfig) GetCurveResistanceParamR4() float32 { + if x != nil { + return x.CurveResistanceParamR4 + } + return 0 +} + +func (x *TrainDynamicConfig) GetRevolvingMassParam() float32 { + if x != nil { + return x.RevolvingMassParam + } + return 0 +} + +func (x *TrainDynamicConfig) GetJump() bool { + if x != nil { + return x.Jump + } + return false +} + +func (x *TrainDynamicConfig) GetSlip() float32 { + if x != nil { + return x.Slip + } + return 0 +} + +func (x *TrainDynamicConfig) GetSlide() int32 { + if x != nil { + return x.Slide + } + return 0 +} + +func (x *TrainDynamicConfig) GetStopSign() int32 { + if x != nil { + return x.StopSign + } + return 0 +} + +func (x *TrainDynamicConfig) GetRadarEnable() bool { + if x != nil { + return x.RadarEnable + } + return false +} + +func (x *TrainDynamicConfig) GetRadarCheckSpeed() float32 { + if x != nil { + return x.RadarCheckSpeed + } + return 0 +} + +func (x *TrainDynamicConfig) GetRadarCheckTime() int32 { + if x != nil { + return x.RadarCheckTime + } + return 0 +} + // vobc发过来的列车信息 type TrainVobcState struct { state protoimpl.MessageState @@ -1229,7 +1421,7 @@ type TrainVobcState struct { func (x *TrainVobcState) Reset() { *x = TrainVobcState{} if protoimpl.UnsafeEnabled { - mi := &file_device_state_proto_msgTypes[9] + mi := &file_device_state_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1242,7 +1434,7 @@ func (x *TrainVobcState) String() string { func (*TrainVobcState) ProtoMessage() {} func (x *TrainVobcState) ProtoReflect() protoreflect.Message { - mi := &file_device_state_proto_msgTypes[9] + mi := &file_device_state_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1255,7 +1447,7 @@ func (x *TrainVobcState) ProtoReflect() protoreflect.Message { // Deprecated: Use TrainVobcState.ProtoReflect.Descriptor instead. func (*TrainVobcState) Descriptor() ([]byte, []int) { - return file_device_state_proto_rawDescGZIP(), []int{9} + return file_device_state_proto_rawDescGZIP(), []int{10} } func (x *TrainVobcState) GetLifeSignal() int32 { @@ -1576,7 +1768,7 @@ type TrainMapState struct { func (x *TrainMapState) Reset() { *x = TrainMapState{} if protoimpl.UnsafeEnabled { - mi := &file_device_state_proto_msgTypes[10] + mi := &file_device_state_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1589,7 +1781,7 @@ func (x *TrainMapState) String() string { func (*TrainMapState) ProtoMessage() {} func (x *TrainMapState) ProtoReflect() protoreflect.Message { - mi := &file_device_state_proto_msgTypes[10] + mi := &file_device_state_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1602,7 +1794,7 @@ func (x *TrainMapState) ProtoReflect() protoreflect.Message { // Deprecated: Use TrainMapState.ProtoReflect.Descriptor instead. func (*TrainMapState) Descriptor() ([]byte, []int) { - return file_device_state_proto_rawDescGZIP(), []int{10} + return file_device_state_proto_rawDescGZIP(), []int{11} } func (x *TrainMapState) GetId() string { @@ -2049,7 +2241,7 @@ type ReplyState struct { func (x *ReplyState) Reset() { *x = ReplyState{} if protoimpl.UnsafeEnabled { - mi := &file_device_state_proto_msgTypes[11] + mi := &file_device_state_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2062,7 +2254,7 @@ func (x *ReplyState) String() string { func (*ReplyState) ProtoMessage() {} func (x *ReplyState) ProtoReflect() protoreflect.Message { - mi := &file_device_state_proto_msgTypes[11] + mi := &file_device_state_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2075,7 +2267,7 @@ func (x *ReplyState) ProtoReflect() protoreflect.Message { // Deprecated: Use ReplyState.ProtoReflect.Descriptor instead. func (*ReplyState) Descriptor() ([]byte, []int) { - return file_device_state_proto_rawDescGZIP(), []int{11} + return file_device_state_proto_rawDescGZIP(), []int{12} } func (x *ReplyState) GetId() uint32 { @@ -2113,7 +2305,7 @@ type ButtonState struct { func (x *ButtonState) Reset() { *x = ButtonState{} if protoimpl.UnsafeEnabled { - mi := &file_device_state_proto_msgTypes[12] + mi := &file_device_state_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2126,7 +2318,7 @@ func (x *ButtonState) String() string { func (*ButtonState) ProtoMessage() {} func (x *ButtonState) ProtoReflect() protoreflect.Message { - mi := &file_device_state_proto_msgTypes[12] + mi := &file_device_state_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2139,7 +2331,7 @@ func (x *ButtonState) ProtoReflect() protoreflect.Message { // Deprecated: Use ButtonState.ProtoReflect.Descriptor instead. func (*ButtonState) Descriptor() ([]byte, []int) { - return file_device_state_proto_rawDescGZIP(), []int{12} + return file_device_state_proto_rawDescGZIP(), []int{13} } func (x *ButtonState) GetId() uint32 { @@ -2176,7 +2368,7 @@ type AlarmState struct { func (x *AlarmState) Reset() { *x = AlarmState{} if protoimpl.UnsafeEnabled { - mi := &file_device_state_proto_msgTypes[13] + mi := &file_device_state_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2189,7 +2381,7 @@ func (x *AlarmState) String() string { func (*AlarmState) ProtoMessage() {} func (x *AlarmState) ProtoReflect() protoreflect.Message { - mi := &file_device_state_proto_msgTypes[13] + mi := &file_device_state_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2202,7 +2394,7 @@ func (x *AlarmState) ProtoReflect() protoreflect.Message { // Deprecated: Use AlarmState.ProtoReflect.Descriptor instead. func (*AlarmState) Descriptor() ([]byte, []int) { - return file_device_state_proto_rawDescGZIP(), []int{13} + return file_device_state_proto_rawDescGZIP(), []int{14} } func (x *AlarmState) GetId() uint32 { @@ -2232,7 +2424,7 @@ type LightState struct { func (x *LightState) Reset() { *x = LightState{} if protoimpl.UnsafeEnabled { - mi := &file_device_state_proto_msgTypes[14] + mi := &file_device_state_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2245,7 +2437,7 @@ func (x *LightState) String() string { func (*LightState) ProtoMessage() {} func (x *LightState) ProtoReflect() protoreflect.Message { - mi := &file_device_state_proto_msgTypes[14] + mi := &file_device_state_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2258,7 +2450,7 @@ func (x *LightState) ProtoReflect() protoreflect.Message { // Deprecated: Use LightState.ProtoReflect.Descriptor instead. func (*LightState) Descriptor() ([]byte, []int) { - return file_device_state_proto_rawDescGZIP(), []int{14} + return file_device_state_proto_rawDescGZIP(), []int{15} } func (x *LightState) GetId() uint32 { @@ -2289,7 +2481,7 @@ type PsdState struct { func (x *PsdState) Reset() { *x = PsdState{} if protoimpl.UnsafeEnabled { - mi := &file_device_state_proto_msgTypes[15] + mi := &file_device_state_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2302,7 +2494,7 @@ func (x *PsdState) String() string { func (*PsdState) ProtoMessage() {} func (x *PsdState) ProtoReflect() protoreflect.Message { - mi := &file_device_state_proto_msgTypes[15] + mi := &file_device_state_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2315,7 +2507,7 @@ func (x *PsdState) ProtoReflect() protoreflect.Message { // Deprecated: Use PsdState.ProtoReflect.Descriptor instead. func (*PsdState) Descriptor() ([]byte, []int) { - return file_device_state_proto_rawDescGZIP(), []int{15} + return file_device_state_proto_rawDescGZIP(), []int{16} } func (x *PsdState) GetId() uint32 { @@ -2354,7 +2546,7 @@ type AsdState struct { func (x *AsdState) Reset() { *x = AsdState{} if protoimpl.UnsafeEnabled { - mi := &file_device_state_proto_msgTypes[16] + mi := &file_device_state_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2367,7 +2559,7 @@ func (x *AsdState) String() string { func (*AsdState) ProtoMessage() {} func (x *AsdState) ProtoReflect() protoreflect.Message { - mi := &file_device_state_proto_msgTypes[16] + mi := &file_device_state_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2380,7 +2572,7 @@ func (x *AsdState) ProtoReflect() protoreflect.Message { // Deprecated: Use AsdState.ProtoReflect.Descriptor instead. func (*AsdState) Descriptor() ([]byte, []int) { - return file_device_state_proto_rawDescGZIP(), []int{16} + return file_device_state_proto_rawDescGZIP(), []int{17} } func (x *AsdState) GetCode() int32 { @@ -2424,7 +2616,7 @@ type KeyState struct { func (x *KeyState) Reset() { *x = KeyState{} if protoimpl.UnsafeEnabled { - mi := &file_device_state_proto_msgTypes[17] + mi := &file_device_state_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2437,7 +2629,7 @@ func (x *KeyState) String() string { func (*KeyState) ProtoMessage() {} func (x *KeyState) ProtoReflect() protoreflect.Message { - mi := &file_device_state_proto_msgTypes[17] + mi := &file_device_state_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2450,7 +2642,7 @@ func (x *KeyState) ProtoReflect() protoreflect.Message { // Deprecated: Use KeyState.ProtoReflect.Descriptor instead. func (*KeyState) Descriptor() ([]byte, []int) { - return file_device_state_proto_rawDescGZIP(), []int{17} + return file_device_state_proto_rawDescGZIP(), []int{18} } func (x *KeyState) GetId() uint32 { @@ -2480,7 +2672,7 @@ type MkxJState struct { func (x *MkxJState) Reset() { *x = MkxJState{} if protoimpl.UnsafeEnabled { - mi := &file_device_state_proto_msgTypes[18] + mi := &file_device_state_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2493,7 +2685,7 @@ func (x *MkxJState) String() string { func (*MkxJState) ProtoMessage() {} func (x *MkxJState) ProtoReflect() protoreflect.Message { - mi := &file_device_state_proto_msgTypes[18] + mi := &file_device_state_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2506,7 +2698,7 @@ func (x *MkxJState) ProtoReflect() protoreflect.Message { // Deprecated: Use MkxJState.ProtoReflect.Descriptor instead. func (*MkxJState) Descriptor() ([]byte, []int) { - return file_device_state_proto_rawDescGZIP(), []int{18} + return file_device_state_proto_rawDescGZIP(), []int{19} } func (x *MkxJState) GetCode() string { @@ -2537,7 +2729,7 @@ type BaliseState struct { func (x *BaliseState) Reset() { *x = BaliseState{} if protoimpl.UnsafeEnabled { - mi := &file_device_state_proto_msgTypes[19] + mi := &file_device_state_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2550,7 +2742,7 @@ func (x *BaliseState) String() string { func (*BaliseState) ProtoMessage() {} func (x *BaliseState) ProtoReflect() protoreflect.Message { - mi := &file_device_state_proto_msgTypes[19] + mi := &file_device_state_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2563,7 +2755,7 @@ func (x *BaliseState) ProtoReflect() protoreflect.Message { // Deprecated: Use BaliseState.ProtoReflect.Descriptor instead. func (*BaliseState) Descriptor() ([]byte, []int) { - return file_device_state_proto_rawDescGZIP(), []int{19} + return file_device_state_proto_rawDescGZIP(), []int{20} } func (x *BaliseState) GetId() uint32 { @@ -2608,7 +2800,7 @@ type VariationStatus struct { func (x *VariationStatus) Reset() { *x = VariationStatus{} if protoimpl.UnsafeEnabled { - mi := &file_device_state_proto_msgTypes[20] + mi := &file_device_state_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2621,7 +2813,7 @@ func (x *VariationStatus) String() string { func (*VariationStatus) ProtoMessage() {} func (x *VariationStatus) ProtoReflect() protoreflect.Message { - mi := &file_device_state_proto_msgTypes[20] + mi := &file_device_state_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2634,7 +2826,7 @@ func (x *VariationStatus) ProtoReflect() protoreflect.Message { // Deprecated: Use VariationStatus.ProtoReflect.Descriptor instead. func (*VariationStatus) Descriptor() ([]byte, []int) { - return file_device_state_proto_rawDescGZIP(), []int{20} + return file_device_state_proto_rawDescGZIP(), []int{21} } func (x *VariationStatus) GetUpdatedTrain() []*TrainMapState { @@ -2707,7 +2899,7 @@ type AllDevicesStatus struct { func (x *AllDevicesStatus) Reset() { *x = AllDevicesStatus{} if protoimpl.UnsafeEnabled { - mi := &file_device_state_proto_msgTypes[21] + mi := &file_device_state_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2720,7 +2912,7 @@ func (x *AllDevicesStatus) String() string { func (*AllDevicesStatus) ProtoMessage() {} func (x *AllDevicesStatus) ProtoReflect() protoreflect.Message { - mi := &file_device_state_proto_msgTypes[21] + mi := &file_device_state_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2733,7 +2925,7 @@ func (x *AllDevicesStatus) ProtoReflect() protoreflect.Message { // Deprecated: Use AllDevicesStatus.ProtoReflect.Descriptor instead. func (*AllDevicesStatus) Descriptor() ([]byte, []int) { - return file_device_state_proto_rawDescGZIP(), []int{21} + return file_device_state_proto_rawDescGZIP(), []int{22} } func (x *AllDevicesStatus) GetTrainState() []*TrainMapState { @@ -2838,7 +3030,7 @@ type PushedDevicesStatus struct { func (x *PushedDevicesStatus) Reset() { *x = PushedDevicesStatus{} if protoimpl.UnsafeEnabled { - mi := &file_device_state_proto_msgTypes[22] + mi := &file_device_state_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2851,7 +3043,7 @@ func (x *PushedDevicesStatus) String() string { func (*PushedDevicesStatus) ProtoMessage() {} func (x *PushedDevicesStatus) ProtoReflect() protoreflect.Message { - mi := &file_device_state_proto_msgTypes[22] + mi := &file_device_state_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2864,7 +3056,7 @@ func (x *PushedDevicesStatus) ProtoReflect() protoreflect.Message { // Deprecated: Use PushedDevicesStatus.ProtoReflect.Descriptor instead. func (*PushedDevicesStatus) Descriptor() ([]byte, []int) { - return file_device_state_proto_rawDescGZIP(), []int{22} + return file_device_state_proto_rawDescGZIP(), []int{23} } func (x *PushedDevicesStatus) GetAll() bool { @@ -2902,7 +3094,7 @@ type SimulationStatus struct { func (x *SimulationStatus) Reset() { *x = SimulationStatus{} if protoimpl.UnsafeEnabled { - mi := &file_device_state_proto_msgTypes[23] + mi := &file_device_state_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2915,7 +3107,7 @@ func (x *SimulationStatus) String() string { func (*SimulationStatus) ProtoMessage() {} func (x *SimulationStatus) ProtoReflect() protoreflect.Message { - mi := &file_device_state_proto_msgTypes[23] + mi := &file_device_state_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2928,7 +3120,7 @@ func (x *SimulationStatus) ProtoReflect() protoreflect.Message { // Deprecated: Use SimulationStatus.ProtoReflect.Descriptor instead. func (*SimulationStatus) Descriptor() ([]byte, []int) { - return file_device_state_proto_rawDescGZIP(), []int{23} + return file_device_state_proto_rawDescGZIP(), []int{24} } func (x *SimulationStatus) GetSimulationId() string { @@ -3045,7 +3237,7 @@ var file_device_state_proto_rawDesc = []byte{ 0x6c, 0x44, 0x65, 0x6c, 0x61, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x77, 0x68, 0x65, 0x65, 0x6c, 0x44, 0x69, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x18, 0x10, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x77, 0x68, 0x65, 0x65, 0x6c, 0x44, 0x69, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, - 0x22, 0xcd, 0x06, 0x0a, 0x11, 0x54, 0x72, 0x61, 0x69, 0x6e, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, + 0x22, 0x98, 0x07, 0x0a, 0x11, 0x54, 0x72, 0x61, 0x69, 0x6e, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x68, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x68, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x68, 0x65, 0x61, 0x64, 0x4c, 0x69, 0x6e, 0x6b, @@ -3098,6 +3290,53 @@ var file_device_state_proto_rawDesc = []byte{ 0x49, 0x6e, 0x74, 0x65, 0x72, 0x72, 0x75, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x6c, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x16, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x6c, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x49, 0x0a, 0x12, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x17, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, + 0x74, 0x61, 0x74, 0x65, 0x2e, 0x54, 0x72, 0x61, 0x69, 0x6e, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, + 0x63, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x12, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x44, 0x79, + 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0xa2, 0x05, 0x0a, 0x12, + 0x54, 0x72, 0x61, 0x69, 0x6e, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x61, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x04, 0x6d, 0x61, 0x73, 0x73, 0x12, 0x32, 0x0a, 0x14, 0x62, 0x61, 0x73, 0x65, 0x52, 0x65, + 0x73, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x41, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x02, 0x52, 0x14, 0x62, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x69, 0x73, 0x74, + 0x61, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x41, 0x12, 0x32, 0x0a, 0x14, 0x62, 0x61, + 0x73, 0x65, 0x52, 0x65, 0x73, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x42, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x14, 0x62, 0x61, 0x73, 0x65, 0x52, 0x65, + 0x73, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x42, 0x12, 0x32, + 0x0a, 0x14, 0x62, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x43, 0x18, 0x04, 0x20, 0x01, 0x28, 0x02, 0x52, 0x14, 0x62, 0x61, + 0x73, 0x65, 0x52, 0x65, 0x73, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x43, 0x12, 0x36, 0x0a, 0x16, 0x63, 0x75, 0x72, 0x76, 0x65, 0x52, 0x65, 0x73, 0x69, 0x73, + 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x52, 0x31, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x02, 0x52, 0x16, 0x63, 0x75, 0x72, 0x76, 0x65, 0x52, 0x65, 0x73, 0x69, 0x73, 0x74, 0x61, + 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x52, 0x31, 0x12, 0x36, 0x0a, 0x16, 0x63, 0x75, + 0x72, 0x76, 0x65, 0x52, 0x65, 0x73, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x52, 0x32, 0x18, 0x06, 0x20, 0x01, 0x28, 0x02, 0x52, 0x16, 0x63, 0x75, 0x72, 0x76, + 0x65, 0x52, 0x65, 0x73, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x52, 0x32, 0x12, 0x36, 0x0a, 0x16, 0x63, 0x75, 0x72, 0x76, 0x65, 0x52, 0x65, 0x73, 0x69, 0x73, + 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x52, 0x33, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x02, 0x52, 0x16, 0x63, 0x75, 0x72, 0x76, 0x65, 0x52, 0x65, 0x73, 0x69, 0x73, 0x74, 0x61, + 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x52, 0x33, 0x12, 0x36, 0x0a, 0x16, 0x63, 0x75, + 0x72, 0x76, 0x65, 0x52, 0x65, 0x73, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x52, 0x34, 0x18, 0x08, 0x20, 0x01, 0x28, 0x02, 0x52, 0x16, 0x63, 0x75, 0x72, 0x76, + 0x65, 0x52, 0x65, 0x73, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x52, 0x34, 0x12, 0x2e, 0x0a, 0x12, 0x72, 0x65, 0x76, 0x6f, 0x6c, 0x76, 0x69, 0x6e, 0x67, 0x4d, + 0x61, 0x73, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x09, 0x20, 0x01, 0x28, 0x02, 0x52, 0x12, + 0x72, 0x65, 0x76, 0x6f, 0x6c, 0x76, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x73, 0x73, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6a, 0x75, 0x6d, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x04, 0x6a, 0x75, 0x6d, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6c, 0x69, 0x70, 0x18, 0x0b, + 0x20, 0x01, 0x28, 0x02, 0x52, 0x04, 0x73, 0x6c, 0x69, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x6c, + 0x69, 0x64, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x6c, 0x69, 0x64, 0x65, + 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x74, 0x6f, 0x70, 0x53, 0x69, 0x67, 0x6e, 0x18, 0x0d, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x08, 0x73, 0x74, 0x6f, 0x70, 0x53, 0x69, 0x67, 0x6e, 0x12, 0x20, 0x0a, 0x0b, + 0x72, 0x61, 0x64, 0x61, 0x72, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x0b, 0x72, 0x61, 0x64, 0x61, 0x72, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x28, + 0x0a, 0x0f, 0x72, 0x61, 0x64, 0x61, 0x72, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x70, 0x65, 0x65, + 0x64, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0f, 0x72, 0x61, 0x64, 0x61, 0x72, 0x43, 0x68, + 0x65, 0x63, 0x6b, 0x53, 0x70, 0x65, 0x65, 0x64, 0x12, 0x26, 0x0a, 0x0e, 0x72, 0x61, 0x64, 0x61, + 0x72, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x10, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x0e, 0x72, 0x61, 0x64, 0x61, 0x72, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x84, 0x08, 0x0a, 0x0e, 0x54, 0x72, 0x61, 0x69, 0x6e, 0x56, 0x6f, 0x62, 0x63, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x6c, 0x69, 0x66, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x6c, 0x69, 0x66, 0x65, 0x53, 0x69, 0x67, @@ -3456,7 +3695,7 @@ func file_device_state_proto_rawDescGZIP() []byte { } var file_device_state_proto_enumTypes = make([]protoimpl.EnumInfo, 3) -var file_device_state_proto_msgTypes = make([]protoimpl.MessageInfo, 24) +var file_device_state_proto_msgTypes = make([]protoimpl.MessageInfo, 25) var file_device_state_proto_goTypes = []interface{}{ (SectionType)(0), // 0: state.SectionType (Signal_Aspect)(0), // 1: state.Signal.Aspect @@ -3470,56 +3709,58 @@ var file_device_state_proto_goTypes = []interface{}{ (*StationState)(nil), // 9: state.StationState (*TrainState)(nil), // 10: state.TrainState (*TrainDynamicState)(nil), // 11: state.TrainDynamicState - (*TrainVobcState)(nil), // 12: state.TrainVobcState - (*TrainMapState)(nil), // 13: state.TrainMapState - (*ReplyState)(nil), // 14: state.ReplyState - (*ButtonState)(nil), // 15: state.ButtonState - (*AlarmState)(nil), // 16: state.AlarmState - (*LightState)(nil), // 17: state.LightState - (*PsdState)(nil), // 18: state.PsdState - (*AsdState)(nil), // 19: state.AsdState - (*KeyState)(nil), // 20: state.KeyState - (*MkxJState)(nil), // 21: state.MkxJState - (*BaliseState)(nil), // 22: state.BaliseState - (*VariationStatus)(nil), // 23: state.VariationStatus - (*AllDevicesStatus)(nil), // 24: state.AllDevicesStatus - (*PushedDevicesStatus)(nil), // 25: state.PushedDevicesStatus - (*SimulationStatus)(nil), // 26: state.SimulationStatus - (*data_proto.KilometerSystem)(nil), // 27: graphicData.KilometerSystem + (*TrainDynamicConfig)(nil), // 12: state.TrainDynamicConfig + (*TrainVobcState)(nil), // 13: state.TrainVobcState + (*TrainMapState)(nil), // 14: state.TrainMapState + (*ReplyState)(nil), // 15: state.ReplyState + (*ButtonState)(nil), // 16: state.ButtonState + (*AlarmState)(nil), // 17: state.AlarmState + (*LightState)(nil), // 18: state.LightState + (*PsdState)(nil), // 19: state.PsdState + (*AsdState)(nil), // 20: state.AsdState + (*KeyState)(nil), // 21: state.KeyState + (*MkxJState)(nil), // 22: state.MkxJState + (*BaliseState)(nil), // 23: state.BaliseState + (*VariationStatus)(nil), // 24: state.VariationStatus + (*AllDevicesStatus)(nil), // 25: state.AllDevicesStatus + (*PushedDevicesStatus)(nil), // 26: state.PushedDevicesStatus + (*SimulationStatus)(nil), // 27: state.SimulationStatus + (*data_proto.KilometerSystem)(nil), // 28: graphicData.KilometerSystem } var file_device_state_proto_depIdxs = []int32{ 1, // 0: state.SignalState.aspect:type_name -> state.Signal.Aspect - 14, // 1: state.PlatformState.spksState:type_name -> state.ReplyState - 21, // 2: state.PlatformState.mkxJState:type_name -> state.MkxJState + 15, // 1: state.PlatformState.spksState:type_name -> state.ReplyState + 22, // 2: state.PlatformState.mkxJState:type_name -> state.MkxJState 11, // 3: state.TrainState.dynamicState:type_name -> state.TrainDynamicState - 12, // 4: state.TrainState.vobcState:type_name -> state.TrainVobcState - 19, // 5: state.PsdState.asdStates:type_name -> state.AsdState - 14, // 6: state.MkxJState.replyState:type_name -> state.ReplyState - 27, // 7: state.BaliseState.km:type_name -> graphicData.KilometerSystem - 13, // 8: state.VariationStatus.updatedTrain:type_name -> state.TrainMapState - 5, // 9: state.VariationStatus.updatedSwitch:type_name -> state.SwitchState - 4, // 10: state.VariationStatus.updatedSection:type_name -> state.SectionState - 14, // 11: state.VariationStatus.updatedReply:type_name -> state.ReplyState - 13, // 12: state.AllDevicesStatus.trainState:type_name -> state.TrainMapState - 5, // 13: state.AllDevicesStatus.switchState:type_name -> state.SwitchState - 4, // 14: state.AllDevicesStatus.sectionState:type_name -> state.SectionState - 14, // 15: state.AllDevicesStatus.replyState:type_name -> state.ReplyState - 6, // 16: state.AllDevicesStatus.signalState:type_name -> state.SignalState - 15, // 17: state.AllDevicesStatus.buttonState:type_name -> state.ButtonState - 16, // 18: state.AllDevicesStatus.AlarmState:type_name -> state.AlarmState - 17, // 19: state.AllDevicesStatus.LightState:type_name -> state.LightState - 18, // 20: state.AllDevicesStatus.psdState:type_name -> state.PsdState - 20, // 21: state.AllDevicesStatus.KeyState:type_name -> state.KeyState - 8, // 22: state.AllDevicesStatus.platformState:type_name -> state.PlatformState - 22, // 23: state.AllDevicesStatus.baliseState:type_name -> state.BaliseState - 23, // 24: state.PushedDevicesStatus.varStatus:type_name -> state.VariationStatus - 24, // 25: state.PushedDevicesStatus.allStatus:type_name -> state.AllDevicesStatus - 2, // 26: state.SimulationStatus.state:type_name -> state.SimulationStatus.SimulationState - 27, // [27:27] is the sub-list for method output_type - 27, // [27:27] is the sub-list for method input_type - 27, // [27:27] is the sub-list for extension type_name - 27, // [27:27] is the sub-list for extension extendee - 0, // [0:27] is the sub-list for field type_name + 13, // 4: state.TrainState.vobcState:type_name -> state.TrainVobcState + 12, // 5: state.TrainDynamicState.trainDynamicConfig:type_name -> state.TrainDynamicConfig + 20, // 6: state.PsdState.asdStates:type_name -> state.AsdState + 15, // 7: state.MkxJState.replyState:type_name -> state.ReplyState + 28, // 8: state.BaliseState.km:type_name -> graphicData.KilometerSystem + 14, // 9: state.VariationStatus.updatedTrain:type_name -> state.TrainMapState + 5, // 10: state.VariationStatus.updatedSwitch:type_name -> state.SwitchState + 4, // 11: state.VariationStatus.updatedSection:type_name -> state.SectionState + 15, // 12: state.VariationStatus.updatedReply:type_name -> state.ReplyState + 14, // 13: state.AllDevicesStatus.trainState:type_name -> state.TrainMapState + 5, // 14: state.AllDevicesStatus.switchState:type_name -> state.SwitchState + 4, // 15: state.AllDevicesStatus.sectionState:type_name -> state.SectionState + 15, // 16: state.AllDevicesStatus.replyState:type_name -> state.ReplyState + 6, // 17: state.AllDevicesStatus.signalState:type_name -> state.SignalState + 16, // 18: state.AllDevicesStatus.buttonState:type_name -> state.ButtonState + 17, // 19: state.AllDevicesStatus.AlarmState:type_name -> state.AlarmState + 18, // 20: state.AllDevicesStatus.LightState:type_name -> state.LightState + 19, // 21: state.AllDevicesStatus.psdState:type_name -> state.PsdState + 21, // 22: state.AllDevicesStatus.KeyState:type_name -> state.KeyState + 8, // 23: state.AllDevicesStatus.platformState:type_name -> state.PlatformState + 23, // 24: state.AllDevicesStatus.baliseState:type_name -> state.BaliseState + 24, // 25: state.PushedDevicesStatus.varStatus:type_name -> state.VariationStatus + 25, // 26: state.PushedDevicesStatus.allStatus:type_name -> state.AllDevicesStatus + 2, // 27: state.SimulationStatus.state:type_name -> state.SimulationStatus.SimulationState + 28, // [28:28] is the sub-list for method output_type + 28, // [28:28] is the sub-list for method input_type + 28, // [28:28] is the sub-list for extension type_name + 28, // [28:28] is the sub-list for extension extendee + 0, // [0:28] is the sub-list for field type_name } func init() { file_device_state_proto_init() } @@ -3637,7 +3878,7 @@ func file_device_state_proto_init() { } } file_device_state_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TrainVobcState); i { + switch v := v.(*TrainDynamicConfig); i { case 0: return &v.state case 1: @@ -3649,7 +3890,7 @@ func file_device_state_proto_init() { } } file_device_state_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TrainMapState); i { + switch v := v.(*TrainVobcState); i { case 0: return &v.state case 1: @@ -3661,7 +3902,7 @@ func file_device_state_proto_init() { } } file_device_state_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReplyState); i { + switch v := v.(*TrainMapState); i { case 0: return &v.state case 1: @@ -3673,7 +3914,7 @@ func file_device_state_proto_init() { } } file_device_state_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ButtonState); i { + switch v := v.(*ReplyState); i { case 0: return &v.state case 1: @@ -3685,7 +3926,7 @@ func file_device_state_proto_init() { } } file_device_state_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AlarmState); i { + switch v := v.(*ButtonState); i { case 0: return &v.state case 1: @@ -3697,7 +3938,7 @@ func file_device_state_proto_init() { } } file_device_state_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LightState); i { + switch v := v.(*AlarmState); i { case 0: return &v.state case 1: @@ -3709,7 +3950,7 @@ func file_device_state_proto_init() { } } file_device_state_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PsdState); i { + switch v := v.(*LightState); i { case 0: return &v.state case 1: @@ -3721,7 +3962,7 @@ func file_device_state_proto_init() { } } file_device_state_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AsdState); i { + switch v := v.(*PsdState); i { case 0: return &v.state case 1: @@ -3733,7 +3974,7 @@ func file_device_state_proto_init() { } } file_device_state_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*KeyState); i { + switch v := v.(*AsdState); i { case 0: return &v.state case 1: @@ -3745,7 +3986,7 @@ func file_device_state_proto_init() { } } file_device_state_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MkxJState); i { + switch v := v.(*KeyState); i { case 0: return &v.state case 1: @@ -3757,7 +3998,7 @@ func file_device_state_proto_init() { } } file_device_state_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BaliseState); i { + switch v := v.(*MkxJState); i { case 0: return &v.state case 1: @@ -3769,7 +4010,7 @@ func file_device_state_proto_init() { } } file_device_state_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VariationStatus); i { + switch v := v.(*BaliseState); i { case 0: return &v.state case 1: @@ -3781,7 +4022,7 @@ func file_device_state_proto_init() { } } file_device_state_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AllDevicesStatus); i { + switch v := v.(*VariationStatus); i { case 0: return &v.state case 1: @@ -3793,7 +4034,7 @@ func file_device_state_proto_init() { } } file_device_state_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PushedDevicesStatus); i { + switch v := v.(*AllDevicesStatus); i { case 0: return &v.state case 1: @@ -3805,6 +4046,18 @@ func file_device_state_proto_init() { } } file_device_state_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PushedDevicesStatus); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_device_state_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SimulationStatus); i { case 0: return &v.state @@ -3823,7 +4076,7 @@ func file_device_state_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_device_state_proto_rawDesc, NumEnums: 3, - NumMessages: 24, + NumMessages: 25, NumExtensions: 0, NumServices: 0, }, diff --git a/third_party/dynamics/dynamics.go b/third_party/dynamics/dynamics.go index 935e447..690f12e 100644 --- a/third_party/dynamics/dynamics.go +++ b/third_party/dynamics/dynamics.go @@ -30,7 +30,8 @@ type Dynamics interface { RequestAddTrain(info *message.InitTrainInfo) error // 请求移除列车 RequestRemoveTrain(req *message.RemoveTrainReq) error - + //请求变更列车参数 + TrainOperationConfig(req *message.TrainOperationConfig) error // 启动动力学消息功能 Start(manager DynamicsMessageManager) error // 停止动力学消息功能 @@ -167,6 +168,25 @@ func (d *dynamics) RequestRemoveTrain(req *message.RemoveTrainReq) error { return nil } +// 动力学数据设置 +func (d *dynamics) TrainOperationConfig(req *message.TrainOperationConfig) error { + if !d.runConfig.Open { + return nil + } + data, _ := json.Marshal(req) + url := d.buildUrl("/api/config") + resp, err := d.httpClient.Post(url, "application/json", bytes.NewBuffer(data)) + defer resp.Body.Close() + if err != nil { + return fmt.Errorf("动力学移除列车请求异常: %v", err) + } + var bodyData []byte + _, err = resp.Body.Read(bodyData) + if err != nil { + return fmt.Errorf("动力学移除列车响应读取异常: %v", err) + } + return nil +} func (d *dynamics) Start(manager DynamicsMessageManager) error { if manager == nil { panic("启动动力学消息服务错误: DynamicsMessageManager不能为nil") diff --git a/third_party/message/dynamics_http.go b/third_party/message/dynamics_http.go index 19c09a3..35cd0c0 100644 --- a/third_party/message/dynamics_http.go +++ b/third_party/message/dynamics_http.go @@ -50,3 +50,24 @@ type Curve struct { EndLinkOffset int32 `json:"endLinkOffset"` Curvature int32 `json:"curvature"` } +type TrainOperationConfig struct { + TrainIndex int `json:"trainIndex"` + Mass int `json:"mass" form:"mass"` //列车的质量(100=1ton) + Length int `json:"列车的长度(cm)"` + BaseResistanceParamA float32 `json:"基本阻力参数A"` + BaseResistanceParamB float32 `json:"基本阻力参数B"` + BaseResistanceParamC float32 `json:"基本阻力参数C"` + CurveResistanceParamR1 float32 `json:"曲线阻力参数R1"` + CurveResistanceParamR2 float32 `json:"曲线阻力参数R2"` + CurveResistanceParamR3 float32 `json:"曲线阻力参数R3"` + CurveResistanceParamR4 float32 `json:"曲线阻力参数R4"` + RevolvingMassParam float32 `json:"旋转质量参数"` + Jump bool `json:"是否跳跃"` + Slip float32 `json:"打滑(%)"` + Slide int `json:"前溜/后溜(mm)(正数前溜,负数后溜)"` + StopSign int `json:"过标/欠标(mm)(正数过标,负数欠标)"` + WheelDiameter int `json:"轮径(mm)"` + //RadarSpeed float32 `json:"雷达速度差值(m/s)"` + //RadarDuration int `json:"雷达速度差值持续时间(ms)"` + //RadarIsValid bool `json:"雷达是否失效"` +} diff --git a/ts/simulation/wayside/memory/wayside_memory_train.go b/ts/simulation/wayside/memory/wayside_memory_train.go index 0048b22..5a3511f 100644 --- a/ts/simulation/wayside/memory/wayside_memory_train.go +++ b/ts/simulation/wayside/memory/wayside_memory_train.go @@ -90,6 +90,55 @@ func AddTrainState(vs *VerifySimulation, status *state_proto.TrainState, mapId i return status } +func UpdateConfigTrain(vs *VerifySimulation, ct *dto.ConfigTrainReqDto) { + allTrainMap := &vs.Memory.Status.TrainStateMap + data, ok := allTrainMap.Load(ct.TrainId) + if !ok { + panic(sys_error.New(fmt.Sprintf("列车【%s】不存在", ct.TrainId))) + } + trainState, ok := data.(*state_proto.TrainState) + if !ok { + panic(sys_error.New(fmt.Sprintf("列车参数修改断言:列车【%s】不存在", ct.TrainId))) + } + if trainState.DynamicState.TrainDynamicConfig == nil { + trainState.DynamicState.TrainDynamicConfig = &state_proto.TrainDynamicConfig{} + } + trainState.DynamicState.TrainDynamicConfig.BaseResistanceParamA = ct.ConfigData.BaseResistanceParamA + trainState.DynamicState.TrainDynamicConfig.BaseResistanceParamB = ct.ConfigData.BaseResistanceParamB + trainState.DynamicState.TrainDynamicConfig.BaseResistanceParamC = ct.ConfigData.BaseResistanceParamC + trainState.DynamicState.TrainDynamicConfig.CurveResistanceParamR1 = ct.ConfigData.CurveResistanceParamR1 + trainState.DynamicState.TrainDynamicConfig.CurveResistanceParamR2 = ct.ConfigData.CurveResistanceParamR2 + trainState.DynamicState.TrainDynamicConfig.CurveResistanceParamR3 = ct.ConfigData.CurveResistanceParamR3 + trainState.DynamicState.TrainDynamicConfig.CurveResistanceParamR4 = ct.ConfigData.CurveResistanceParamR4 + trainState.TrainLength = ct.ConfigData.Length + trainState.DynamicState.TrainDynamicConfig.Mass = ct.ConfigData.Mass + trainState.DynamicState.TrainDynamicConfig.Jump = ct.ConfigData.Jump + trainState.DynamicState.TrainDynamicConfig.Slip = ct.ConfigData.Slip + trainState.DynamicState.TrainDynamicConfig.Slide = ct.ConfigData.Slide + trainState.DynamicState.TrainDynamicConfig.StopSign = ct.ConfigData.StopSign + trainState.DynamicState.TrainDynamicConfig.RadarEnable = ct.ConfigData.RadarEnable + trainState.DynamicState.TrainDynamicConfig.RadarCheckSpeed = ct.ConfigData.RadarCheckSpeed + trainState.DynamicState.TrainDynamicConfig.RadarCheckTime = ct.ConfigData.RadarCheckTime + trainState.WheelDiameter = ct.ConfigData.WheelDiameter + requestDynamic(ct) +} + +func requestDynamic(ct *dto.ConfigTrainReqDto) { + cd := ct.ConfigData + msg := &message.TrainOperationConfig{TrainIndex: ct.TrainId, Mass: int(cd.Mass), Length: int(cd.Length), + BaseResistanceParamA: cd.BaseResistanceParamA, BaseResistanceParamB: cd.BaseResistanceParamB, + BaseResistanceParamC: cd.BaseResistanceParamC, CurveResistanceParamR1: cd.CurveResistanceParamR1, + CurveResistanceParamR2: cd.CurveResistanceParamR2, CurveResistanceParamR3: cd.CurveResistanceParamR3, + CurveResistanceParamR4: cd.CurveResistanceParamR4, RevolvingMassParam: cd.RevolvingMassParam, + Jump: cd.Jump, Slip: cd.Slip, Slide: int(cd.Slide), + StopSign: int(cd.StopSign), WheelDiameter: int(cd.WheelDiameter)} + err := dynamics.Default().TrainOperationConfig(msg) + if err != nil { + slog.Error("列车参数变更请求动力学失败", err) + panic(sys_error.New(fmt.Sprintf("列车参数变更请求动力学失败"))) + } +} + // 修改列车信息 func UpdateTrainInfo(vs *VerifySimulation, status *state_proto.TrainState) *state_proto.TrainState { allTrainMap := &vs.Memory.Status.TrainStateMap