动力学列车数据配置

This commit is contained in:
tiger_zhou 2024-01-17 17:05:08 +08:00
parent 79356df717
commit 7d8ab26712
4 changed files with 89 additions and 41 deletions

View File

@ -267,7 +267,7 @@ func addTrain(c *gin.Context) {
TrainEndsB: memory.DtoTrainEndsToStateProto(req.ConfigTrain.TrainEndsB),
},*/
}
memory.AddTrainStateNew(simulation, rsp, req.ConfigTrain, req.MapId)
memory.AddTrainStateNew(simulation, rsp, req.ConfigTrain, req.TrainEndsA, req.TrainEndsB, req.MapId)
c.JSON(http.StatusOK, &rsp)
}

View File

@ -5014,6 +5014,22 @@ const docTemplate = `{
}
]
},
"TrainEndsA": {
"description": "车辆A端",
"allOf": [
{
"$ref": "#/definitions/dto.ConfigTrainEnds"
}
]
},
"TrainEndsB": {
"description": "车辆B端",
"allOf": [
{
"$ref": "#/definitions/dto.ConfigTrainEnds"
}
]
},
"devicePort": {
"description": "道岔端口",
"type": "string"
@ -5222,22 +5238,6 @@ const docTemplate = `{
"dto.ConfigTrainData": {
"type": "object",
"properties": {
"TrainEndsA": {
"description": "车辆A端",
"allOf": [
{
"$ref": "#/definitions/dto.ConfigTrainEnds"
}
]
},
"TrainEndsB": {
"description": "车辆B端",
"allOf": [
{
"$ref": "#/definitions/dto.ConfigTrainEnds"
}
]
},
"baseResistanceParamA": {
"description": "Mass int32 ` + "`" + `json:\"mass\" form:\"mass\"` + "`" + ` // 列车的质量100=1ton",
"type": "number"
@ -5316,6 +5316,22 @@ const docTemplate = `{
"dto.ConfigTrainReqDto": {
"type": "object",
"properties": {
"TrainEndsA": {
"description": "车辆A端",
"allOf": [
{
"$ref": "#/definitions/dto.ConfigTrainEnds"
}
]
},
"TrainEndsB": {
"description": "车辆B端",
"allOf": [
{
"$ref": "#/definitions/dto.ConfigTrainEnds"
}
]
},
"TrainId": {
"description": "列车Id",
"type": "integer"
@ -5818,6 +5834,9 @@ const docTemplate = `{
"dto.TrainInfoDto": {
"type": "object",
"properties": {
"TrainConfigData": {
"$ref": "#/definitions/dto.ConfigTrainData"
},
"carriage_length": {
"type": "integer"
},

View File

@ -5008,6 +5008,22 @@
}
]
},
"TrainEndsA": {
"description": "车辆A端",
"allOf": [
{
"$ref": "#/definitions/dto.ConfigTrainEnds"
}
]
},
"TrainEndsB": {
"description": "车辆B端",
"allOf": [
{
"$ref": "#/definitions/dto.ConfigTrainEnds"
}
]
},
"devicePort": {
"description": "道岔端口",
"type": "string"
@ -5216,22 +5232,6 @@
"dto.ConfigTrainData": {
"type": "object",
"properties": {
"TrainEndsA": {
"description": "车辆A端",
"allOf": [
{
"$ref": "#/definitions/dto.ConfigTrainEnds"
}
]
},
"TrainEndsB": {
"description": "车辆B端",
"allOf": [
{
"$ref": "#/definitions/dto.ConfigTrainEnds"
}
]
},
"baseResistanceParamA": {
"description": "Mass int32 `json:\"mass\" form:\"mass\"` // 列车的质量100=1ton",
"type": "number"
@ -5310,6 +5310,22 @@
"dto.ConfigTrainReqDto": {
"type": "object",
"properties": {
"TrainEndsA": {
"description": "车辆A端",
"allOf": [
{
"$ref": "#/definitions/dto.ConfigTrainEnds"
}
]
},
"TrainEndsB": {
"description": "车辆B端",
"allOf": [
{
"$ref": "#/definitions/dto.ConfigTrainEnds"
}
]
},
"TrainId": {
"description": "列车Id",
"type": "integer"
@ -5812,6 +5828,9 @@
"dto.TrainInfoDto": {
"type": "object",
"properties": {
"TrainConfigData": {
"$ref": "#/definitions/dto.ConfigTrainData"
},
"carriage_length": {
"type": "integer"
},

View File

@ -41,6 +41,14 @@ definitions:
allOf:
- $ref: '#/definitions/dto.ConfigTrainData'
description: 列车数据配置
TrainEndsA:
allOf:
- $ref: '#/definitions/dto.ConfigTrainEnds'
description: 车辆A端
TrainEndsB:
allOf:
- $ref: '#/definitions/dto.ConfigTrainEnds'
description: 车辆B端
devicePort:
description: 道岔端口
type: string
@ -183,14 +191,6 @@ definitions:
type: object
dto.ConfigTrainData:
properties:
TrainEndsA:
allOf:
- $ref: '#/definitions/dto.ConfigTrainEnds'
description: 车辆A端
TrainEndsB:
allOf:
- $ref: '#/definitions/dto.ConfigTrainEnds'
description: 车辆B端
baseResistanceParamA:
description: Mass int32 `json:"mass" form:"mass"` //
列车的质量100=1ton
@ -249,6 +249,14 @@ definitions:
type: object
dto.ConfigTrainReqDto:
properties:
TrainEndsA:
allOf:
- $ref: '#/definitions/dto.ConfigTrainEnds'
description: 车辆A端
TrainEndsB:
allOf:
- $ref: '#/definitions/dto.ConfigTrainEnds'
description: 车辆B端
TrainId:
description: 列车Id
type: integer
@ -589,6 +597,8 @@ definitions:
type: object
dto.TrainInfoDto:
properties:
TrainConfigData:
$ref: '#/definitions/dto.ConfigTrainData'
carriage_length:
type: integer
description: