动力学列车数据配置

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

View File

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