proto文件增加设备状态;实现应答器的相关接口
This commit is contained in:
parent
32b4b9ba02
commit
0818438098
|
@ -296,7 +296,7 @@ func historyPublishedGiById(c *gin.Context) {
|
|||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param id path query dto.PublishFallBackDto true "查询参数"
|
||||
// @Success 200 {object} true
|
||||
// @Success 200 {object} bool
|
||||
// @Failure 401 {object} dto.ErrorDto
|
||||
// @Failure 500 {object} dto.ErrorDto
|
||||
// @Router /api/v1/publishedGi/fallbackVersion [post]
|
||||
|
|
|
@ -40,6 +40,11 @@ func InitSimulationRouter(api *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddle
|
|||
authed.GET("/:id/getMapKilometerRange", getMapKilometerRange)
|
||||
authed.POST("/psl/operation", pslBtnOperation)
|
||||
authed.POST("/psd/operation", psdOperation)
|
||||
authed.PUT("/balise/position/modify", balisePositionModify)
|
||||
authed.PUT("/balise/position/reset", transponderPositionReset)
|
||||
authed.PUT("/balise/telegram/modify", baliseTelegramModify)
|
||||
authed.PUT("/balise/telegram/reset", baliseTelegramReset)
|
||||
authed.PUT("/balise/reset", baliseReset)
|
||||
|
||||
// 初始化地图信息
|
||||
initPublishMapInfo()
|
||||
|
@ -552,36 +557,151 @@ func relayOperation(c *gin.Context) {
|
|||
c.JSON(http.StatusOK, "ok")
|
||||
}
|
||||
|
||||
// 获取ATS测试-操作继电器
|
||||
// 应答器移位
|
||||
//
|
||||
// @Summary 获取ATS测试-操作继电器
|
||||
// @Summary 应答器移位
|
||||
//
|
||||
// @Security JwtAuth
|
||||
//
|
||||
// @Description ATS测试-操作继电器
|
||||
// @Description 应答器移位
|
||||
// @Tags ATS测试仿真Api
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param Authorization header string true "JWT Token"
|
||||
// @Param RelayOperationReqDto body dto.RelayOperationReqDto true "ATS测试仿真-操作继电器"
|
||||
// @Param BaliseMoveReqDto body dto.BaliseMoveReqDto true "应答器移位"
|
||||
//
|
||||
// @Success 200 {object} string
|
||||
// @Failure 500 {object} dto.ErrorDto
|
||||
// @Router /api/v1/simulation/transponder/move [post]
|
||||
func transponderMove(c *gin.Context) {
|
||||
req := &dto.TransponderMoveReqDto{}
|
||||
// @Router /api/v1/simulation/balise/position/modify [put]
|
||||
func balisePositionModify(c *gin.Context) {
|
||||
req := &dto.BaliseMoveReqDto{}
|
||||
if err := c.ShouldBind(&req); err != nil {
|
||||
panic(sys_error.New("应答器移位操作失败,请求参数异常", err))
|
||||
}
|
||||
simulation := checkDeviceDataAndReturn(req.SimulationId)
|
||||
slog.Info("传入状态参数", req)
|
||||
err := memory.TransponderMove(simulation, req)
|
||||
err := memory.BalisePositionModify(simulation, req)
|
||||
if err != nil {
|
||||
panic(sys_error.New(fmt.Sprintf("应答器移位操作失败,%s", err.Error()), err))
|
||||
}
|
||||
c.JSON(http.StatusOK, "ok")
|
||||
}
|
||||
|
||||
// 应答器复位
|
||||
//
|
||||
// @Summary 应答器复位
|
||||
//
|
||||
// @Security JwtAuth
|
||||
//
|
||||
// @Description 应答器复位
|
||||
// @Tags ATS测试仿真Api
|
||||
// @Accept json
|
||||
// @Param Authorization header string true "JWT Token"
|
||||
// @Param BaliseReqDto body dto.BaliseReqDto true "应答器复位"
|
||||
//
|
||||
// @Success 200 {object} string
|
||||
// @Failure 500 {object} dto.ErrorDto
|
||||
// @Router /api/v1/simulation/balise/position/reset [put]
|
||||
func transponderPositionReset(c *gin.Context) {
|
||||
req := &dto.BaliseReqDto{}
|
||||
if err := c.ShouldBind(&req); err != nil {
|
||||
panic(sys_error.New("应答器复位操作失败,请求参数异常", err))
|
||||
}
|
||||
simulation := checkDeviceDataAndReturn(req.SimulationId)
|
||||
slog.Info("传入状态参数", req)
|
||||
err := memory.BalisePositionReset(simulation, req)
|
||||
if err != nil {
|
||||
panic(sys_error.New(fmt.Sprintf("应答器复位操作失败,%s", err.Error()), err))
|
||||
}
|
||||
c.JSON(http.StatusOK, "ok")
|
||||
}
|
||||
|
||||
// 修改应答器报文
|
||||
//
|
||||
// @Summary 修改应答器报文
|
||||
//
|
||||
// @Security JwtAuth
|
||||
//
|
||||
// @Description 修改应答器报文
|
||||
// @Tags ATS测试仿真Api
|
||||
// @Accept json
|
||||
// @Param Authorization header string true "JWT Token"
|
||||
// @Param BaliseModifyTelegramReqDto body dto.BaliseModifyTelegramReqDto true "修改应答器报文"
|
||||
//
|
||||
// @Success 200 {object} string
|
||||
// @Failure 500 {object} dto.ErrorDto
|
||||
// @Router /api/v1/simulation/balise/telegram/modify [put]
|
||||
func baliseTelegramModify(c *gin.Context) {
|
||||
req := &dto.BaliseModifyTelegramReqDto{}
|
||||
if err := c.ShouldBind(&req); err != nil {
|
||||
panic(sys_error.New("应答器修改报文操作失败,请求参数异常", err))
|
||||
}
|
||||
simulation := checkDeviceDataAndReturn(req.SimulationId)
|
||||
slog.Info("传入状态参数", req)
|
||||
err := memory.BaliseTelegramModify(simulation, req)
|
||||
if err != nil {
|
||||
panic(sys_error.New(fmt.Sprintf("应答器修改报文操作失败,%s", err.Error()), err))
|
||||
}
|
||||
c.JSON(http.StatusOK, "ok")
|
||||
}
|
||||
|
||||
// 重置应答器报文
|
||||
//
|
||||
// @Summary 重置应答器报文
|
||||
//
|
||||
// @Security JwtAuth
|
||||
//
|
||||
// @Description 重置应答器报文
|
||||
// @Tags ATS测试仿真Api
|
||||
// @Accept json
|
||||
// @Param Authorization header string true "JWT Token"
|
||||
// @Param BaliseReqDto body dto.BaliseReqDto true "重置应答器报文"
|
||||
//
|
||||
// @Success 200 {object} string
|
||||
// @Failure 500 {object} dto.ErrorDto
|
||||
// @Router /api/v1/simulation/balise/telegram/reset [put]
|
||||
func baliseTelegramReset(c *gin.Context) {
|
||||
req := &dto.BaliseReqDto{}
|
||||
if err := c.ShouldBind(&req); err != nil {
|
||||
panic(sys_error.New("应答器重置报文操作失败,请求参数异常", err))
|
||||
}
|
||||
simulation := checkDeviceDataAndReturn(req.SimulationId)
|
||||
slog.Info("传入状态参数", req)
|
||||
err := memory.BaliseTelegramReset(simulation, req)
|
||||
if err != nil {
|
||||
panic(sys_error.New(fmt.Sprintf("应答器重置报文操作失败,%s", err.Error()), err))
|
||||
}
|
||||
c.JSON(http.StatusOK, "ok")
|
||||
}
|
||||
|
||||
// 重置应答器状态
|
||||
//
|
||||
// @Summary 重置应答器状态
|
||||
//
|
||||
// @Security JwtAuth
|
||||
//
|
||||
// @Description 重置应答器状态
|
||||
// @Tags ATS测试仿真Api
|
||||
// @Accept json
|
||||
// @Param Authorization header string true "JWT Token"
|
||||
// @Param BaliseReqDto body dto.BaliseReqDto true "重置应答器状态"
|
||||
//
|
||||
// @Success 200 {object} string
|
||||
// @Failure 500 {object} dto.ErrorDto
|
||||
// @Router /api/v1/simulation/balise/reset [put]
|
||||
func baliseReset(c *gin.Context) {
|
||||
req := &dto.BaliseReqDto{}
|
||||
if err := c.ShouldBind(&req); err != nil {
|
||||
panic(sys_error.New("应答器状态重置操作失败,请求参数异常", err))
|
||||
}
|
||||
simulation := checkDeviceDataAndReturn(req.SimulationId)
|
||||
slog.Info("传入状态参数", req)
|
||||
err := memory.BaliseReset(simulation, req)
|
||||
if err != nil {
|
||||
panic(sys_error.New(fmt.Sprintf("应答器状态重置操作失败,%s", err.Error()), err))
|
||||
}
|
||||
c.JSON(http.StatusOK, "ok")
|
||||
}
|
||||
|
||||
// 获取仿真设备数据并返回
|
||||
func checkDeviceDataAndReturn(simId string) *memory.VerifySimulation {
|
||||
deviceMemory := ts.FindSimulation(simId)
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 999608fa88a430cba9bef8915f76993a0e4c6d8e
|
||||
Subproject commit 00828fb909e5797c3ef269c37551d48e507f08bf
|
476
docs/docs.go
476
docs/docs.go
|
@ -2192,7 +2192,7 @@ const docTemplate = `{
|
|||
{
|
||||
"type": "integer",
|
||||
"description": "id",
|
||||
"name": "id",
|
||||
"name": "PublishFallBackDto",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
|
@ -2219,6 +2219,60 @@ const docTemplate = `{
|
|||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/publishedGi/fallbackVersion": {
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
"JwtAuth": []
|
||||
}
|
||||
],
|
||||
"description": "发布地图回退到历史版本",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"发布的图形数据Api"
|
||||
],
|
||||
"summary": "发布地图回退到历史版本",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"name": "mapId",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"name": "versionId",
|
||||
"in": "query",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/dto.ErrorDto"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/dto.ErrorDto"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/publishedGi/list": {
|
||||
"get": {
|
||||
"security": [
|
||||
|
@ -2363,6 +2417,12 @@ const docTemplate = `{
|
|||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "boolean",
|
||||
"description": "是否只要上架数据",
|
||||
"name": "release",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"example": 10,
|
||||
|
@ -3215,6 +3275,251 @@ const docTemplate = `{
|
|||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/simulation/balise/position/modify": {
|
||||
"put": {
|
||||
"security": [
|
||||
{
|
||||
"JwtAuth": []
|
||||
}
|
||||
],
|
||||
"description": "应答器移位",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"ATS测试仿真Api"
|
||||
],
|
||||
"summary": "应答器移位",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "JWT Token",
|
||||
"name": "Authorization",
|
||||
"in": "header",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"description": "应答器移位",
|
||||
"name": "BaliseMoveReqDto",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/dto.BaliseMoveReqDto"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/dto.ErrorDto"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/simulation/balise/position/reset": {
|
||||
"put": {
|
||||
"security": [
|
||||
{
|
||||
"JwtAuth": []
|
||||
}
|
||||
],
|
||||
"description": "应答器复位",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"ATS测试仿真Api"
|
||||
],
|
||||
"summary": "应答器复位",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "JWT Token",
|
||||
"name": "Authorization",
|
||||
"in": "header",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"description": "应答器复位",
|
||||
"name": "BaliseReqDto",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/dto.BaliseReqDto"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/dto.ErrorDto"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/simulation/balise/reset": {
|
||||
"put": {
|
||||
"security": [
|
||||
{
|
||||
"JwtAuth": []
|
||||
}
|
||||
],
|
||||
"description": "重置应答器状态",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"ATS测试仿真Api"
|
||||
],
|
||||
"summary": "重置应答器状态",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "JWT Token",
|
||||
"name": "Authorization",
|
||||
"in": "header",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"description": "重置应答器状态",
|
||||
"name": "BaliseReqDto",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/dto.BaliseReqDto"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/dto.ErrorDto"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/simulation/balise/telegram/modify": {
|
||||
"put": {
|
||||
"security": [
|
||||
{
|
||||
"JwtAuth": []
|
||||
}
|
||||
],
|
||||
"description": "修改应答器报文",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"ATS测试仿真Api"
|
||||
],
|
||||
"summary": "修改应答器报文",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "JWT Token",
|
||||
"name": "Authorization",
|
||||
"in": "header",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"description": "修改应答器报文",
|
||||
"name": "BaliseModifyTelegramReqDto",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/dto.BaliseModifyTelegramReqDto"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/dto.ErrorDto"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/simulation/balise/telegram/reset": {
|
||||
"put": {
|
||||
"security": [
|
||||
{
|
||||
"JwtAuth": []
|
||||
}
|
||||
],
|
||||
"description": "重置应答器报文",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"ATS测试仿真Api"
|
||||
],
|
||||
"summary": "重置应答器报文",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "JWT Token",
|
||||
"name": "Authorization",
|
||||
"in": "header",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"description": "重置应答器报文",
|
||||
"name": "BaliseReqDto",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/dto.BaliseReqDto"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/dto.ErrorDto"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/simulation/check/data": {
|
||||
"post": {
|
||||
"security": [
|
||||
|
@ -4100,6 +4405,11 @@ const docTemplate = `{
|
|||
"type": "string",
|
||||
"name": "name",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"name": "pid",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
|
@ -4616,7 +4926,7 @@ const docTemplate = `{
|
|||
},
|
||||
"id": {
|
||||
"description": "物理区段、道岔ID",
|
||||
"type": "string"
|
||||
"type": "integer"
|
||||
},
|
||||
"mapId": {
|
||||
"description": "场景ID",
|
||||
|
@ -4694,7 +5004,7 @@ const docTemplate = `{
|
|||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string"
|
||||
"type": "integer"
|
||||
},
|
||||
"mapId": {
|
||||
"type": "integer"
|
||||
|
@ -4713,6 +5023,71 @@ const docTemplate = `{
|
|||
}
|
||||
}
|
||||
},
|
||||
"dto.BaliseModifyTelegramReqDto": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"baliseId": {
|
||||
"description": "应答器ID",
|
||||
"type": "integer"
|
||||
},
|
||||
"mapId": {
|
||||
"description": "地图ID",
|
||||
"type": "integer"
|
||||
},
|
||||
"simulationId": {
|
||||
"description": "仿真ID",
|
||||
"type": "string"
|
||||
},
|
||||
"telegram": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"dto.BaliseMoveReqDto": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"baliseId": {
|
||||
"description": "应答器ID",
|
||||
"type": "integer"
|
||||
},
|
||||
"km": {
|
||||
"description": "公里标",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/graphicData.KilometerSystem"
|
||||
}
|
||||
]
|
||||
},
|
||||
"mapId": {
|
||||
"description": "地图ID",
|
||||
"type": "integer"
|
||||
},
|
||||
"simulationId": {
|
||||
"description": "仿真ID",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"dto.BaliseReqDto": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"baliseId": {
|
||||
"description": "应答器ID",
|
||||
"type": "integer"
|
||||
},
|
||||
"mapId": {
|
||||
"description": "地图ID",
|
||||
"type": "integer"
|
||||
},
|
||||
"simulationId": {
|
||||
"description": "仿真ID",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"dto.CheckMapDataReqDto": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
|
@ -4767,7 +5142,7 @@ const docTemplate = `{
|
|||
"type": "boolean"
|
||||
},
|
||||
"id": {
|
||||
"type": "string"
|
||||
"type": "integer"
|
||||
},
|
||||
"mapId": {
|
||||
"type": "integer"
|
||||
|
@ -4780,14 +5155,14 @@ const docTemplate = `{
|
|||
"dto.IBPButtonOperationReqDto": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"buttonCode",
|
||||
"buttonId",
|
||||
"mapId",
|
||||
"simulationId",
|
||||
"stationId"
|
||||
],
|
||||
"properties": {
|
||||
"buttonCode": {
|
||||
"type": "string"
|
||||
"buttonId": {
|
||||
"type": "integer"
|
||||
},
|
||||
"down": {
|
||||
"type": "boolean"
|
||||
|
@ -4799,7 +5174,7 @@ const docTemplate = `{
|
|||
"type": "string"
|
||||
},
|
||||
"stationId": {
|
||||
"type": "string"
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -4814,8 +5189,8 @@ const docTemplate = `{
|
|||
"gear": {
|
||||
"type": "integer"
|
||||
},
|
||||
"keyCode": {
|
||||
"type": "string"
|
||||
"keyId": {
|
||||
"type": "integer"
|
||||
},
|
||||
"mapId": {
|
||||
"type": "integer"
|
||||
|
@ -4824,7 +5199,7 @@ const docTemplate = `{
|
|||
"type": "string"
|
||||
},
|
||||
"stationId": {
|
||||
"type": "string"
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -4946,7 +5321,7 @@ const docTemplate = `{
|
|||
"type": "boolean"
|
||||
},
|
||||
"gateBoxId": {
|
||||
"type": "string"
|
||||
"type": "integer"
|
||||
},
|
||||
"mapId": {
|
||||
"type": "integer"
|
||||
|
@ -4959,6 +5334,9 @@ const docTemplate = `{
|
|||
"dto.PublishHistoryDto": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"current": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"id": {
|
||||
"type": "integer"
|
||||
},
|
||||
|
@ -5000,11 +5378,20 @@ const docTemplate = `{
|
|||
"publishAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"publisher": {
|
||||
"type": "string"
|
||||
},
|
||||
"status": {
|
||||
"type": "integer"
|
||||
},
|
||||
"type": {
|
||||
"type": "integer"
|
||||
},
|
||||
"userID": {
|
||||
"type": "integer"
|
||||
},
|
||||
"version": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -5058,7 +5445,7 @@ const docTemplate = `{
|
|||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string"
|
||||
"type": "integer"
|
||||
},
|
||||
"mapId": {
|
||||
"type": "integer"
|
||||
|
@ -5107,7 +5494,7 @@ const docTemplate = `{
|
|||
]
|
||||
},
|
||||
"id": {
|
||||
"type": "string"
|
||||
"type": "integer"
|
||||
},
|
||||
"mapId": {
|
||||
"type": "integer"
|
||||
|
@ -5295,6 +5682,38 @@ 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": [
|
||||
|
@ -5468,7 +5887,11 @@ const docTemplate = `{
|
|||
},
|
||||
"deviceId": {
|
||||
"description": "设备id",
|
||||
"type": "string"
|
||||
"type": "integer"
|
||||
},
|
||||
"group": {
|
||||
"description": "开门操作的编组",
|
||||
"type": "integer"
|
||||
},
|
||||
"mapId": {
|
||||
"description": "图id",
|
||||
|
@ -5498,9 +5921,6 @@ const docTemplate = `{
|
|||
4,
|
||||
5,
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
10,
|
||||
11,
|
||||
12,
|
||||
|
@ -5518,29 +5938,23 @@ const docTemplate = `{
|
|||
"Psd_CancelAsdCannotOpen": "取消滑动门无法开门",
|
||||
"Psd_CancelForce": "取消强制",
|
||||
"Psd_CancelGm": "取消关门",
|
||||
"Psd_CancelKm4": "取消四编组开门",
|
||||
"Psd_CancelKm8": "取消八编组开门",
|
||||
"Psd_CancelKm": "取消开门",
|
||||
"Psd_CancelQDTC": "取消启动探测",
|
||||
"Psd_CancelTZTC": "取消停止探测",
|
||||
"Psd_ForceGm": "强制关门",
|
||||
"Psd_ForceKm4": "强制四编组开门",
|
||||
"Psd_ForceKm8": "强制八编组开门",
|
||||
"Psd_ForceKm": "强制开门",
|
||||
"Psd_Gm": "关门",
|
||||
"Psd_Km4": "四编组开门",
|
||||
"Psd_Km8": "八编组开门",
|
||||
"Psd_Km": "开门",
|
||||
"Psd_QDTC": "启动探测",
|
||||
"Psd_TZTC": "停止探测"
|
||||
},
|
||||
"x-enum-varnames": [
|
||||
"Psd_Undefined",
|
||||
"Psd_Km4",
|
||||
"Psd_CancelKm4",
|
||||
"Psd_Km8",
|
||||
"Psd_CancelKm8",
|
||||
"Psd_Km",
|
||||
"Psd_CancelKm",
|
||||
"Psd_Gm",
|
||||
"Psd_CancelGm",
|
||||
"Psd_ForceKm4",
|
||||
"Psd_ForceKm8",
|
||||
"Psd_ForceKm",
|
||||
"Psd_ForceGm",
|
||||
"Psd_CancelForce",
|
||||
"Psd_AsdCannotOpen",
|
||||
|
@ -5630,7 +6044,7 @@ const docTemplate = `{
|
|||
"properties": {
|
||||
"deviceId": {
|
||||
"description": "设备id",
|
||||
"type": "string"
|
||||
"type": "integer"
|
||||
},
|
||||
"mapId": {
|
||||
"description": "图id",
|
||||
|
|
|
@ -2185,7 +2185,7 @@
|
|||
{
|
||||
"type": "integer",
|
||||
"description": "id",
|
||||
"name": "id",
|
||||
"name": "PublishFallBackDto",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
|
@ -2212,6 +2212,60 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/publishedGi/fallbackVersion": {
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
"JwtAuth": []
|
||||
}
|
||||
],
|
||||
"description": "发布地图回退到历史版本",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"发布的图形数据Api"
|
||||
],
|
||||
"summary": "发布地图回退到历史版本",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "integer",
|
||||
"name": "mapId",
|
||||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"name": "versionId",
|
||||
"in": "query",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/dto.ErrorDto"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/dto.ErrorDto"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/publishedGi/list": {
|
||||
"get": {
|
||||
"security": [
|
||||
|
@ -2356,6 +2410,12 @@
|
|||
"in": "query",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "boolean",
|
||||
"description": "是否只要上架数据",
|
||||
"name": "release",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"example": 10,
|
||||
|
@ -3208,6 +3268,251 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/simulation/balise/position/modify": {
|
||||
"put": {
|
||||
"security": [
|
||||
{
|
||||
"JwtAuth": []
|
||||
}
|
||||
],
|
||||
"description": "应答器移位",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"ATS测试仿真Api"
|
||||
],
|
||||
"summary": "应答器移位",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "JWT Token",
|
||||
"name": "Authorization",
|
||||
"in": "header",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"description": "应答器移位",
|
||||
"name": "BaliseMoveReqDto",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/dto.BaliseMoveReqDto"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/dto.ErrorDto"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/simulation/balise/position/reset": {
|
||||
"put": {
|
||||
"security": [
|
||||
{
|
||||
"JwtAuth": []
|
||||
}
|
||||
],
|
||||
"description": "应答器复位",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"ATS测试仿真Api"
|
||||
],
|
||||
"summary": "应答器复位",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "JWT Token",
|
||||
"name": "Authorization",
|
||||
"in": "header",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"description": "应答器复位",
|
||||
"name": "BaliseReqDto",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/dto.BaliseReqDto"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/dto.ErrorDto"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/simulation/balise/reset": {
|
||||
"put": {
|
||||
"security": [
|
||||
{
|
||||
"JwtAuth": []
|
||||
}
|
||||
],
|
||||
"description": "重置应答器状态",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"ATS测试仿真Api"
|
||||
],
|
||||
"summary": "重置应答器状态",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "JWT Token",
|
||||
"name": "Authorization",
|
||||
"in": "header",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"description": "重置应答器状态",
|
||||
"name": "BaliseReqDto",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/dto.BaliseReqDto"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/dto.ErrorDto"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/simulation/balise/telegram/modify": {
|
||||
"put": {
|
||||
"security": [
|
||||
{
|
||||
"JwtAuth": []
|
||||
}
|
||||
],
|
||||
"description": "修改应答器报文",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"ATS测试仿真Api"
|
||||
],
|
||||
"summary": "修改应答器报文",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "JWT Token",
|
||||
"name": "Authorization",
|
||||
"in": "header",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"description": "修改应答器报文",
|
||||
"name": "BaliseModifyTelegramReqDto",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/dto.BaliseModifyTelegramReqDto"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/dto.ErrorDto"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/simulation/balise/telegram/reset": {
|
||||
"put": {
|
||||
"security": [
|
||||
{
|
||||
"JwtAuth": []
|
||||
}
|
||||
],
|
||||
"description": "重置应答器报文",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"ATS测试仿真Api"
|
||||
],
|
||||
"summary": "重置应答器报文",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "JWT Token",
|
||||
"name": "Authorization",
|
||||
"in": "header",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"description": "重置应答器报文",
|
||||
"name": "BaliseReqDto",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/dto.BaliseReqDto"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/dto.ErrorDto"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/simulation/check/data": {
|
||||
"post": {
|
||||
"security": [
|
||||
|
@ -4093,6 +4398,11 @@
|
|||
"type": "string",
|
||||
"name": "name",
|
||||
"in": "query"
|
||||
},
|
||||
{
|
||||
"type": "integer",
|
||||
"name": "pid",
|
||||
"in": "query"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
|
@ -4609,7 +4919,7 @@
|
|||
},
|
||||
"id": {
|
||||
"description": "物理区段、道岔ID",
|
||||
"type": "string"
|
||||
"type": "integer"
|
||||
},
|
||||
"mapId": {
|
||||
"description": "场景ID",
|
||||
|
@ -4687,7 +4997,7 @@
|
|||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string"
|
||||
"type": "integer"
|
||||
},
|
||||
"mapId": {
|
||||
"type": "integer"
|
||||
|
@ -4706,6 +5016,71 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"dto.BaliseModifyTelegramReqDto": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"baliseId": {
|
||||
"description": "应答器ID",
|
||||
"type": "integer"
|
||||
},
|
||||
"mapId": {
|
||||
"description": "地图ID",
|
||||
"type": "integer"
|
||||
},
|
||||
"simulationId": {
|
||||
"description": "仿真ID",
|
||||
"type": "string"
|
||||
},
|
||||
"telegram": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"dto.BaliseMoveReqDto": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"baliseId": {
|
||||
"description": "应答器ID",
|
||||
"type": "integer"
|
||||
},
|
||||
"km": {
|
||||
"description": "公里标",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/graphicData.KilometerSystem"
|
||||
}
|
||||
]
|
||||
},
|
||||
"mapId": {
|
||||
"description": "地图ID",
|
||||
"type": "integer"
|
||||
},
|
||||
"simulationId": {
|
||||
"description": "仿真ID",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"dto.BaliseReqDto": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"baliseId": {
|
||||
"description": "应答器ID",
|
||||
"type": "integer"
|
||||
},
|
||||
"mapId": {
|
||||
"description": "地图ID",
|
||||
"type": "integer"
|
||||
},
|
||||
"simulationId": {
|
||||
"description": "仿真ID",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"dto.CheckMapDataReqDto": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
|
@ -4760,7 +5135,7 @@
|
|||
"type": "boolean"
|
||||
},
|
||||
"id": {
|
||||
"type": "string"
|
||||
"type": "integer"
|
||||
},
|
||||
"mapId": {
|
||||
"type": "integer"
|
||||
|
@ -4773,14 +5148,14 @@
|
|||
"dto.IBPButtonOperationReqDto": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"buttonCode",
|
||||
"buttonId",
|
||||
"mapId",
|
||||
"simulationId",
|
||||
"stationId"
|
||||
],
|
||||
"properties": {
|
||||
"buttonCode": {
|
||||
"type": "string"
|
||||
"buttonId": {
|
||||
"type": "integer"
|
||||
},
|
||||
"down": {
|
||||
"type": "boolean"
|
||||
|
@ -4792,7 +5167,7 @@
|
|||
"type": "string"
|
||||
},
|
||||
"stationId": {
|
||||
"type": "string"
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -4807,8 +5182,8 @@
|
|||
"gear": {
|
||||
"type": "integer"
|
||||
},
|
||||
"keyCode": {
|
||||
"type": "string"
|
||||
"keyId": {
|
||||
"type": "integer"
|
||||
},
|
||||
"mapId": {
|
||||
"type": "integer"
|
||||
|
@ -4817,7 +5192,7 @@
|
|||
"type": "string"
|
||||
},
|
||||
"stationId": {
|
||||
"type": "string"
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -4939,7 +5314,7 @@
|
|||
"type": "boolean"
|
||||
},
|
||||
"gateBoxId": {
|
||||
"type": "string"
|
||||
"type": "integer"
|
||||
},
|
||||
"mapId": {
|
||||
"type": "integer"
|
||||
|
@ -4952,6 +5327,9 @@
|
|||
"dto.PublishHistoryDto": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"current": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"id": {
|
||||
"type": "integer"
|
||||
},
|
||||
|
@ -4993,11 +5371,20 @@
|
|||
"publishAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"publisher": {
|
||||
"type": "string"
|
||||
},
|
||||
"status": {
|
||||
"type": "integer"
|
||||
},
|
||||
"type": {
|
||||
"type": "integer"
|
||||
},
|
||||
"userID": {
|
||||
"type": "integer"
|
||||
},
|
||||
"version": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -5051,7 +5438,7 @@
|
|||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string"
|
||||
"type": "integer"
|
||||
},
|
||||
"mapId": {
|
||||
"type": "integer"
|
||||
|
@ -5100,7 +5487,7 @@
|
|||
]
|
||||
},
|
||||
"id": {
|
||||
"type": "string"
|
||||
"type": "integer"
|
||||
},
|
||||
"mapId": {
|
||||
"type": "integer"
|
||||
|
@ -5288,6 +5675,38 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"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": [
|
||||
|
@ -5461,7 +5880,11 @@
|
|||
},
|
||||
"deviceId": {
|
||||
"description": "设备id",
|
||||
"type": "string"
|
||||
"type": "integer"
|
||||
},
|
||||
"group": {
|
||||
"description": "开门操作的编组",
|
||||
"type": "integer"
|
||||
},
|
||||
"mapId": {
|
||||
"description": "图id",
|
||||
|
@ -5491,9 +5914,6 @@
|
|||
4,
|
||||
5,
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
10,
|
||||
11,
|
||||
12,
|
||||
|
@ -5511,29 +5931,23 @@
|
|||
"Psd_CancelAsdCannotOpen": "取消滑动门无法开门",
|
||||
"Psd_CancelForce": "取消强制",
|
||||
"Psd_CancelGm": "取消关门",
|
||||
"Psd_CancelKm4": "取消四编组开门",
|
||||
"Psd_CancelKm8": "取消八编组开门",
|
||||
"Psd_CancelKm": "取消开门",
|
||||
"Psd_CancelQDTC": "取消启动探测",
|
||||
"Psd_CancelTZTC": "取消停止探测",
|
||||
"Psd_ForceGm": "强制关门",
|
||||
"Psd_ForceKm4": "强制四编组开门",
|
||||
"Psd_ForceKm8": "强制八编组开门",
|
||||
"Psd_ForceKm": "强制开门",
|
||||
"Psd_Gm": "关门",
|
||||
"Psd_Km4": "四编组开门",
|
||||
"Psd_Km8": "八编组开门",
|
||||
"Psd_Km": "开门",
|
||||
"Psd_QDTC": "启动探测",
|
||||
"Psd_TZTC": "停止探测"
|
||||
},
|
||||
"x-enum-varnames": [
|
||||
"Psd_Undefined",
|
||||
"Psd_Km4",
|
||||
"Psd_CancelKm4",
|
||||
"Psd_Km8",
|
||||
"Psd_CancelKm8",
|
||||
"Psd_Km",
|
||||
"Psd_CancelKm",
|
||||
"Psd_Gm",
|
||||
"Psd_CancelGm",
|
||||
"Psd_ForceKm4",
|
||||
"Psd_ForceKm8",
|
||||
"Psd_ForceKm",
|
||||
"Psd_ForceGm",
|
||||
"Psd_CancelForce",
|
||||
"Psd_AsdCannotOpen",
|
||||
|
@ -5623,7 +6037,7 @@
|
|||
"properties": {
|
||||
"deviceId": {
|
||||
"description": "设备id",
|
||||
"type": "string"
|
||||
"type": "integer"
|
||||
},
|
||||
"mapId": {
|
||||
"description": "图id",
|
||||
|
|
|
@ -16,7 +16,7 @@ definitions:
|
|||
type: integer
|
||||
id:
|
||||
description: 物理区段、道岔ID
|
||||
type: string
|
||||
type: integer
|
||||
mapId:
|
||||
description: 场景ID
|
||||
type: integer
|
||||
|
@ -66,7 +66,7 @@ definitions:
|
|||
dto.AxleSectionOperationReqDto:
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
type: integer
|
||||
mapId:
|
||||
type: integer
|
||||
operation:
|
||||
|
@ -82,6 +82,50 @@ definitions:
|
|||
- mapId
|
||||
- simulationId
|
||||
type: object
|
||||
dto.BaliseModifyTelegramReqDto:
|
||||
properties:
|
||||
baliseId:
|
||||
description: 应答器ID
|
||||
type: integer
|
||||
mapId:
|
||||
description: 地图ID
|
||||
type: integer
|
||||
simulationId:
|
||||
description: 仿真ID
|
||||
type: string
|
||||
telegram:
|
||||
items:
|
||||
type: integer
|
||||
type: array
|
||||
type: object
|
||||
dto.BaliseMoveReqDto:
|
||||
properties:
|
||||
baliseId:
|
||||
description: 应答器ID
|
||||
type: integer
|
||||
km:
|
||||
allOf:
|
||||
- $ref: '#/definitions/graphicData.KilometerSystem'
|
||||
description: 公里标
|
||||
mapId:
|
||||
description: 地图ID
|
||||
type: integer
|
||||
simulationId:
|
||||
description: 仿真ID
|
||||
type: string
|
||||
type: object
|
||||
dto.BaliseReqDto:
|
||||
properties:
|
||||
baliseId:
|
||||
description: 应答器ID
|
||||
type: integer
|
||||
mapId:
|
||||
description: 地图ID
|
||||
type: integer
|
||||
simulationId:
|
||||
description: 仿真ID
|
||||
type: string
|
||||
type: object
|
||||
dto.CheckMapDataReqDto:
|
||||
properties:
|
||||
data:
|
||||
|
@ -114,7 +158,7 @@ definitions:
|
|||
down:
|
||||
type: boolean
|
||||
id:
|
||||
type: string
|
||||
type: integer
|
||||
mapId:
|
||||
type: integer
|
||||
simulationId:
|
||||
|
@ -126,8 +170,8 @@ definitions:
|
|||
type: object
|
||||
dto.IBPButtonOperationReqDto:
|
||||
properties:
|
||||
buttonCode:
|
||||
type: string
|
||||
buttonId:
|
||||
type: integer
|
||||
down:
|
||||
type: boolean
|
||||
mapId:
|
||||
|
@ -135,9 +179,9 @@ definitions:
|
|||
simulationId:
|
||||
type: string
|
||||
stationId:
|
||||
type: string
|
||||
type: integer
|
||||
required:
|
||||
- buttonCode
|
||||
- buttonId
|
||||
- mapId
|
||||
- simulationId
|
||||
- stationId
|
||||
|
@ -146,14 +190,14 @@ definitions:
|
|||
properties:
|
||||
gear:
|
||||
type: integer
|
||||
keyCode:
|
||||
type: string
|
||||
keyId:
|
||||
type: integer
|
||||
mapId:
|
||||
type: integer
|
||||
simulationId:
|
||||
type: string
|
||||
stationId:
|
||||
type: string
|
||||
type: integer
|
||||
required:
|
||||
- mapId
|
||||
- simulationId
|
||||
|
@ -237,7 +281,7 @@ definitions:
|
|||
down:
|
||||
type: boolean
|
||||
gateBoxId:
|
||||
type: string
|
||||
type: integer
|
||||
mapId:
|
||||
type: integer
|
||||
simulationId:
|
||||
|
@ -249,6 +293,8 @@ definitions:
|
|||
type: object
|
||||
dto.PublishHistoryDto:
|
||||
properties:
|
||||
current:
|
||||
type: boolean
|
||||
id:
|
||||
type: integer
|
||||
note:
|
||||
|
@ -276,10 +322,16 @@ definitions:
|
|||
type: array
|
||||
publishAt:
|
||||
type: string
|
||||
publisher:
|
||||
type: string
|
||||
status:
|
||||
type: integer
|
||||
type:
|
||||
type: integer
|
||||
userID:
|
||||
type: integer
|
||||
version:
|
||||
type: integer
|
||||
type: object
|
||||
dto.PublishedGiLinkDto:
|
||||
properties:
|
||||
|
@ -312,7 +364,7 @@ definitions:
|
|||
dto.RelayOperationReqDto:
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
type: integer
|
||||
mapId:
|
||||
type: integer
|
||||
simulationId:
|
||||
|
@ -343,7 +395,7 @@ definitions:
|
|||
- $ref: '#/definitions/state.Signal_Aspect'
|
||||
description: 当操作为Operation.Display时有效,表示显示的信号
|
||||
id:
|
||||
type: string
|
||||
type: integer
|
||||
mapId:
|
||||
type: integer
|
||||
operation:
|
||||
|
@ -476,6 +528,27 @@ 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
|
||||
|
@ -603,9 +676,6 @@ definitions:
|
|||
- 4
|
||||
- 5
|
||||
- 6
|
||||
- 7
|
||||
- 8
|
||||
- 9
|
||||
- 10
|
||||
- 11
|
||||
- 12
|
||||
|
@ -623,28 +693,22 @@ definitions:
|
|||
Psd_CancelAsdCannotOpen: 取消滑动门无法开门
|
||||
Psd_CancelForce: 取消强制
|
||||
Psd_CancelGm: 取消关门
|
||||
Psd_CancelKm4: 取消四编组开门
|
||||
Psd_CancelKm8: 取消八编组开门
|
||||
Psd_CancelKm: 取消开门
|
||||
Psd_CancelQDTC: 取消启动探测
|
||||
Psd_CancelTZTC: 取消停止探测
|
||||
Psd_ForceGm: 强制关门
|
||||
Psd_ForceKm4: 强制四编组开门
|
||||
Psd_ForceKm8: 强制八编组开门
|
||||
Psd_ForceKm: 强制开门
|
||||
Psd_Gm: 关门
|
||||
Psd_Km4: 四编组开门
|
||||
Psd_Km8: 八编组开门
|
||||
Psd_Km: 开门
|
||||
Psd_QDTC: 启动探测
|
||||
Psd_TZTC: 停止探测
|
||||
x-enum-varnames:
|
||||
- Psd_Undefined
|
||||
- Psd_Km4
|
||||
- Psd_CancelKm4
|
||||
- Psd_Km8
|
||||
- Psd_CancelKm8
|
||||
- Psd_Km
|
||||
- Psd_CancelKm
|
||||
- Psd_Gm
|
||||
- Psd_CancelGm
|
||||
- Psd_ForceKm4
|
||||
- Psd_ForceKm8
|
||||
- Psd_ForceKm
|
||||
- Psd_ForceGm
|
||||
- Psd_CancelForce
|
||||
- Psd_AsdCannotOpen
|
||||
|
@ -664,7 +728,10 @@ definitions:
|
|||
type: array
|
||||
deviceId:
|
||||
description: 设备id
|
||||
type: string
|
||||
type: integer
|
||||
group:
|
||||
description: 开门操作的编组
|
||||
type: integer
|
||||
mapId:
|
||||
description: 图id
|
||||
type: integer
|
||||
|
@ -785,7 +852,7 @@ definitions:
|
|||
properties:
|
||||
deviceId:
|
||||
description: 设备id
|
||||
type: string
|
||||
type: integer
|
||||
mapId:
|
||||
description: 图id
|
||||
type: integer
|
||||
|
@ -2208,7 +2275,7 @@ paths:
|
|||
parameters:
|
||||
- description: id
|
||||
in: path
|
||||
name: id
|
||||
name: PublishFallBackDto
|
||||
required: true
|
||||
type: integer
|
||||
produces:
|
||||
|
@ -2290,6 +2357,40 @@ paths:
|
|||
summary: id查询发布的图形数据
|
||||
tags:
|
||||
- 发布的图形数据Api
|
||||
/api/v1/publishedGi/fallbackVersion:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
description: 发布地图回退到历史版本
|
||||
parameters:
|
||||
- in: query
|
||||
name: mapId
|
||||
required: true
|
||||
type: integer
|
||||
- in: query
|
||||
name: versionId
|
||||
required: true
|
||||
type: integer
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
type: boolean
|
||||
"401":
|
||||
description: Unauthorized
|
||||
schema:
|
||||
$ref: '#/definitions/dto.ErrorDto'
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/dto.ErrorDto'
|
||||
security:
|
||||
- JwtAuth: []
|
||||
summary: 发布地图回退到历史版本
|
||||
tags:
|
||||
- 发布的图形数据Api
|
||||
/api/v1/publishedGi/list:
|
||||
get:
|
||||
consumes:
|
||||
|
@ -2374,6 +2475,10 @@ paths:
|
|||
name: current
|
||||
required: true
|
||||
type: integer
|
||||
- description: 是否只要上架数据
|
||||
in: query
|
||||
name: release
|
||||
type: boolean
|
||||
- description: 页面行数
|
||||
example: 10
|
||||
in: query
|
||||
|
@ -2859,6 +2964,161 @@ paths:
|
|||
summary: ATS测试-计轴区段操作
|
||||
tags:
|
||||
- ATS测试仿真Api
|
||||
/api/v1/simulation/balise/position/modify:
|
||||
put:
|
||||
consumes:
|
||||
- application/json
|
||||
description: 应答器移位
|
||||
parameters:
|
||||
- description: JWT Token
|
||||
in: header
|
||||
name: Authorization
|
||||
required: true
|
||||
type: string
|
||||
- description: 应答器移位
|
||||
in: body
|
||||
name: BaliseMoveReqDto
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/dto.BaliseMoveReqDto'
|
||||
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/balise/position/reset:
|
||||
put:
|
||||
consumes:
|
||||
- application/json
|
||||
description: 应答器复位
|
||||
parameters:
|
||||
- description: JWT Token
|
||||
in: header
|
||||
name: Authorization
|
||||
required: true
|
||||
type: string
|
||||
- description: 应答器复位
|
||||
in: body
|
||||
name: BaliseReqDto
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/dto.BaliseReqDto'
|
||||
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/balise/reset:
|
||||
put:
|
||||
consumes:
|
||||
- application/json
|
||||
description: 重置应答器状态
|
||||
parameters:
|
||||
- description: JWT Token
|
||||
in: header
|
||||
name: Authorization
|
||||
required: true
|
||||
type: string
|
||||
- description: 重置应答器状态
|
||||
in: body
|
||||
name: BaliseReqDto
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/dto.BaliseReqDto'
|
||||
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/balise/telegram/modify:
|
||||
put:
|
||||
consumes:
|
||||
- application/json
|
||||
description: 修改应答器报文
|
||||
parameters:
|
||||
- description: JWT Token
|
||||
in: header
|
||||
name: Authorization
|
||||
required: true
|
||||
type: string
|
||||
- description: 修改应答器报文
|
||||
in: body
|
||||
name: BaliseModifyTelegramReqDto
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/dto.BaliseModifyTelegramReqDto'
|
||||
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/balise/telegram/reset:
|
||||
put:
|
||||
consumes:
|
||||
- application/json
|
||||
description: 重置应答器报文
|
||||
parameters:
|
||||
- description: JWT Token
|
||||
in: header
|
||||
name: Authorization
|
||||
required: true
|
||||
type: string
|
||||
- description: 重置应答器报文
|
||||
in: body
|
||||
name: BaliseReqDto
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/dto.BaliseReqDto'
|
||||
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/check/data:
|
||||
post:
|
||||
consumes:
|
||||
|
@ -3539,6 +3799,9 @@ paths:
|
|||
- in: query
|
||||
name: name
|
||||
type: string
|
||||
- in: query
|
||||
name: pid
|
||||
type: integer
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.28.1
|
||||
// protoc-gen-go v1.31.0
|
||||
// protoc v4.23.1
|
||||
// source: request.proto
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@ package dto
|
|||
|
||||
import (
|
||||
"joylink.club/bj-rtsts-server/dto/request_proto"
|
||||
"joylink.club/bj-rtsts-server/ts/protos/graphicData"
|
||||
"joylink.club/bj-rtsts-server/ts/protos/state"
|
||||
)
|
||||
|
||||
|
@ -169,10 +170,25 @@ type RelayOperationReqDto struct {
|
|||
Td bool `form:"td" json:"td"`
|
||||
}
|
||||
|
||||
// TransponderMoveReqDto 应答器移位请求
|
||||
type TransponderMoveReqDto struct {
|
||||
// BaliseMoveReqDto 应答器移位请求
|
||||
type BaliseMoveReqDto struct {
|
||||
SimulationId string `json:"simulationId" form:"simulationId"` //仿真ID
|
||||
TransponderId string `json:"transponderId" form:"transponderId"` //应答器ID
|
||||
LinkId string `json:"linkId" form:"linkId"` //要移动到的link
|
||||
Offset int64 `json:"offset" form:"offset"` //要移动到的Link的偏移量
|
||||
MapId int32 `json:"mapId" form:"mapId"` //地图ID
|
||||
BaliseId uint32 `json:"baliseId" form:"baliseId"` //应答器ID
|
||||
Km graphicData.KilometerSystem `json:"km" form:"km"` //公里标
|
||||
}
|
||||
|
||||
// BaliseModifyTelegramReqDto 修改应答器报文
|
||||
type BaliseModifyTelegramReqDto struct {
|
||||
SimulationId string `json:"simulationId" form:"simulationId"` //仿真ID
|
||||
MapId int32 `json:"mapId" form:"mapId"` //地图ID
|
||||
BaliseId uint32 `json:"baliseId" form:"baliseId"` //应答器ID
|
||||
Telegram []byte
|
||||
}
|
||||
|
||||
// BaliseReqDto 应答器请求
|
||||
type BaliseReqDto struct {
|
||||
SimulationId string `json:"simulationId" form:"simulationId"` //仿真ID
|
||||
MapId int32 `json:"mapId" form:"mapId"` //地图ID
|
||||
BaliseId uint32 `json:"baliseId" form:"baliseId"` //应答器ID
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ func collectRelayState(world ecs.World, mapId int32) ([]*state.ReplyState, error
|
|||
entry, ok := entity.GetEntityByUid(world, u.Uid)
|
||||
if !ok {
|
||||
// 暂时注释,很多继电器都没初始化
|
||||
//return nil, fmt.Errorf("继电器实体不存在: World id=%d, uid=%s", r.vs.World.TransponderId(), u.Uid)
|
||||
//return nil, fmt.Errorf("继电器实体不存在: World id=%d, uid=%s", r.vs.World.BaliseId(), u.Uid)
|
||||
continue
|
||||
}
|
||||
if entry.HasComponent(component.RelayTag) {
|
||||
|
|
|
@ -2,6 +2,7 @@ package message_server
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"joylink.club/rtsssimulation/repository/model/proto"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
|
@ -47,6 +48,10 @@ func NewSfpMs(vs *memory.VerifySimulation, mapId int32) ms_api.MsgTask {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
baliseStates, err := collectBaliseStates(vs.World, mapId)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ststes := &state.PushedDevicesStatus{
|
||||
All: true,
|
||||
AllStatus: &state.AllDevicesStatus{
|
||||
|
@ -57,6 +62,7 @@ func NewSfpMs(vs *memory.VerifySimulation, mapId int32) ms_api.MsgTask {
|
|||
PsdState: psdStates,
|
||||
SectionState: sectionStates,
|
||||
PlatformState: platformStates,
|
||||
BaliseState: baliseStates,
|
||||
},
|
||||
}
|
||||
mqtt.GetMsgClient().PubSfpState(vs.SimulationId, mapId, ststes)
|
||||
|
@ -64,6 +70,33 @@ func NewSfpMs(vs *memory.VerifySimulation, mapId int32) ms_api.MsgTask {
|
|||
}, 200*time.Millisecond)
|
||||
}
|
||||
|
||||
// 收集应答器状态
|
||||
func collectBaliseStates(world ecs.World, mapId int32) ([]*state.BaliseState, error) {
|
||||
uidStructure := memory.QueryUidStructure[*memory.StationUidStructure](mapId)
|
||||
var transponderStates []*state.BaliseState
|
||||
for id, structure := range uidStructure.TransponderIds {
|
||||
entry, ok := entity.GetEntityByUid(world, structure.Uid)
|
||||
if ok {
|
||||
baliseState := &state.BaliseState{
|
||||
Id: id,
|
||||
Telegram: component.BaliseStateType.Get(entry).ValidTelegram,
|
||||
}
|
||||
transponderStates = append(transponderStates, baliseState)
|
||||
km := component.KmType.Get(entry)
|
||||
baliseState.Km = &graphicData.KilometerSystem{
|
||||
Kilometer: km.Value,
|
||||
CoordinateSystem: km.CoordinateSystem,
|
||||
}
|
||||
if km.Direction == proto.Direction_LEFT {
|
||||
baliseState.Km.Direction = graphicData.KilometerSystem_LEFT
|
||||
} else if km.Direction == proto.Direction_RIGHT {
|
||||
baliseState.Km.Direction = graphicData.KilometerSystem_RIGHT
|
||||
}
|
||||
}
|
||||
}
|
||||
return transponderStates, nil
|
||||
}
|
||||
|
||||
// 收集屏蔽门状态
|
||||
func collectPsdStates(world ecs.World, mapId int32) ([]*state.PsdState, error) {
|
||||
uidStructure := memory.QueryUidStructure[*memory.StationUidStructure](mapId)
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit a4c17218f7e1901fa25c9c90905a1749f5c57068
|
||||
Subproject commit e8c0d58799b13f7311c06e247fb53d32a28e54ec
|
|
@ -1,6 +1,6 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.28.1
|
||||
// protoc-gen-go v1.31.0
|
||||
// protoc v4.23.1
|
||||
// source: ibpGraphics.proto
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.28.1
|
||||
// protoc-gen-go v1.31.0
|
||||
// protoc v4.23.1
|
||||
// source: picture.proto
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.28.1
|
||||
// protoc-gen-go v1.31.0
|
||||
// protoc v4.23.1
|
||||
// source: pslGraphics.proto
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.28.1
|
||||
// protoc-gen-go v1.31.0
|
||||
// protoc v4.23.1
|
||||
// source: relayCabinetLayoutGraphics.proto
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.28.1
|
||||
// protoc-gen-go v1.31.0
|
||||
// protoc v4.23.1
|
||||
// source: stationLayoutGraphics.proto
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -15,7 +15,7 @@ package memory_test
|
|||
// return
|
||||
// }
|
||||
// data := memory.QueryGiData[*graphicData.RtssGraphicStorage](mapId)
|
||||
// deviceId := data.ScreenDoors[0].Common.TransponderId
|
||||
// deviceId := data.ScreenDoors[0].Common.BaliseId
|
||||
|
||||
// simulation := ts.FindSimulation(simId)
|
||||
// wantErr := false
|
||||
|
|
|
@ -4,27 +4,152 @@ import (
|
|||
"fmt"
|
||||
"joylink.club/bj-rtsts-server/dto"
|
||||
"joylink.club/bj-rtsts-server/sys_error"
|
||||
"joylink.club/bj-rtsts-server/ts/protos/graphicData"
|
||||
"joylink.club/rtsssimulation/component"
|
||||
"joylink.club/rtsssimulation/component/component_proto"
|
||||
"joylink.club/rtsssimulation/entity"
|
||||
"joylink.club/rtsssimulation/repository"
|
||||
"joylink.club/rtsssimulation/repository/model/proto"
|
||||
"joylink.club/rtsssimulation/util/number"
|
||||
"sort"
|
||||
)
|
||||
|
||||
func TransponderMove(simulation *VerifySimulation, req *dto.TransponderMoveReqDto) error {
|
||||
worldData := entity.GetWorldData(simulation.World)
|
||||
link := worldData.Repo.FindLink(simulation.uidMap[req.LinkId].Uid)
|
||||
if link == nil {
|
||||
panic(sys_error.New(fmt.Sprintf("未找到[id:%s]的Link", link.Id())))
|
||||
// BalisePositionModify 应答器移位
|
||||
func BalisePositionModify(simulation *VerifySimulation, req *dto.BaliseMoveReqDto) error {
|
||||
uid := QueryMapUidMapByType(req.MapId, &graphicData.Transponder{})[req.BaliseId].Uid
|
||||
transponder := simulation.Repo.FindTransponder(uid)
|
||||
if transponder == nil {
|
||||
return sys_error.New(fmt.Sprintf("未找到[mapId:%d id:%d]的应答器", req.MapId, req.BaliseId))
|
||||
}
|
||||
if req.Offset > link.Length() {
|
||||
panic(sys_error.New(fmt.Sprintf("偏移量[%d]超出Link长度", req.Offset)))
|
||||
//将请求参数中的公里标转为rtss仿真所用的公里标
|
||||
km := &proto.Kilometer{
|
||||
Value: req.Km.Kilometer,
|
||||
CoordinateSystem: req.Km.CoordinateSystem,
|
||||
}
|
||||
te, ok := entity.GetEntityByUid(simulation.World, req.TransponderId)
|
||||
if !ok {
|
||||
panic(sys_error.New(fmt.Sprintf("没有[id:%s]的应答器", req.TransponderId)))
|
||||
if req.Km.Direction == graphicData.KilometerSystem_LEFT {
|
||||
km.Direction = proto.Direction_LEFT
|
||||
} else if req.Km.Direction == graphicData.KilometerSystem_RIGHT {
|
||||
km.Direction = proto.Direction_RIGHT
|
||||
} else {
|
||||
panic(fmt.Sprintf("未知的公里标方向[%d]", req.Km.Direction))
|
||||
}
|
||||
component.LinkPositionType.SetValue(te, component_proto.LinkPosition{
|
||||
LinkId: req.LinkId,
|
||||
Offset: req.Offset,
|
||||
//将应答器所在Link的两端公里标转为请求参数中公里标的坐标系
|
||||
link := transponder.LinkPosition().Link()
|
||||
akm, err := repository.ConvertKilometer(simulation.Repo, link.AKm(), km.CoordinateSystem)
|
||||
if err != nil {
|
||||
panic(sys_error.New("应答器所在Link的起点公里标转换失败"))
|
||||
}
|
||||
bkm, err := repository.ConvertKilometer(simulation.Repo, link.BKm(), km.CoordinateSystem)
|
||||
if err != nil {
|
||||
panic(sys_error.New("应答器所在Link的终点公里标转换失败"))
|
||||
}
|
||||
//筛选出Link上所有的应答器,并按公里标大小排序
|
||||
var transponders []*repository.Transponder
|
||||
for _, device := range link.Devices() {
|
||||
t, ok := device.(*repository.Transponder)
|
||||
if ok {
|
||||
transponders = append(transponders, t)
|
||||
}
|
||||
}
|
||||
sort.Slice(transponders, func(i, j int) bool {
|
||||
aT := transponders[i]
|
||||
bT := transponders[j]
|
||||
aTKm, err := repository.ConvertKilometer(simulation.Repo, aT.Km(), km.CoordinateSystem)
|
||||
if err != nil {
|
||||
panic(sys_error.New(fmt.Sprintf("应答器[id:%s]公里标转换失败", aT.Id())))
|
||||
}
|
||||
bTKm, err := repository.ConvertKilometer(simulation.Repo, bT.Km(), km.CoordinateSystem)
|
||||
if err != nil {
|
||||
panic(sys_error.New(fmt.Sprintf("应答器[id:%s]公里标转换失败", bT.Id())))
|
||||
}
|
||||
return aTKm.Value < bTKm.Value
|
||||
})
|
||||
//确保请求的公里标没有超出Link范围且在相邻的应答器之间
|
||||
var minKm *proto.Kilometer
|
||||
var maxKm *proto.Kilometer
|
||||
if akm.Value < bkm.Value {
|
||||
minKm = akm
|
||||
maxKm = bkm
|
||||
} else {
|
||||
minKm = bkm
|
||||
maxKm = akm
|
||||
}
|
||||
for i, t := range transponders {
|
||||
if t == transponder {
|
||||
if i > 0 {
|
||||
minKm, err = repository.ConvertKilometer(simulation.Repo, transponders[i-1].Km(), km.CoordinateSystem)
|
||||
}
|
||||
if i < len(transponders)-1 {
|
||||
maxKm, err = repository.ConvertKilometer(simulation.Repo, transponders[i+1].Km(), km.CoordinateSystem)
|
||||
}
|
||||
}
|
||||
}
|
||||
//更新应答器公里标和Link位置
|
||||
entry, _ := entity.GetEntityByUid(simulation.World, uid)
|
||||
if km.Value < minKm.Value {
|
||||
km.Value = minKm.Value
|
||||
} else if km.Value > maxKm.Value {
|
||||
km.Value = maxKm.Value
|
||||
}
|
||||
component.KmType.Set(entry, km)
|
||||
offset := number.Abs(km.Value - akm.Value)
|
||||
component.LinkPositionType.Set(entry, &component_proto.LinkPosition{
|
||||
LinkId: link.Id(),
|
||||
Offset: offset,
|
||||
})
|
||||
return nil
|
||||
}
|
||||
|
||||
// BalisePositionReset 应答器复位
|
||||
func BalisePositionReset(simulation *VerifySimulation, req *dto.BaliseReqDto) error {
|
||||
uid := QueryMapUidMapByType(req.MapId, &graphicData.Transponder{})[req.BaliseId].Uid
|
||||
transponder := simulation.Repo.FindTransponder(uid)
|
||||
if transponder == nil {
|
||||
return sys_error.New(fmt.Sprintf("未找到[mapId:%d id:%d]的应答器", req.MapId, req.BaliseId))
|
||||
}
|
||||
entry, _ := entity.GetEntityByUid(simulation.World, uid)
|
||||
component.KmType.Set(entry, transponder.Km())
|
||||
component.LinkPositionType.SetValue(entry, component_proto.LinkPosition{
|
||||
LinkId: transponder.LinkPosition().Link().Id(),
|
||||
Offset: transponder.LinkPosition().Offset(),
|
||||
})
|
||||
return nil
|
||||
}
|
||||
|
||||
// BaliseTelegramModify 修改应答器报文
|
||||
func BaliseTelegramModify(simulation *VerifySimulation, req *dto.BaliseModifyTelegramReqDto) error {
|
||||
uid := QueryMapUidMapByType(req.MapId, &graphicData.Transponder{})[req.BaliseId].Uid
|
||||
entry, ok := entity.GetEntityByUid(simulation.World, uid)
|
||||
if !ok {
|
||||
return sys_error.New(fmt.Sprintf("没有[mapId:%d id:%d]的应答器", req.MapId, req.BaliseId))
|
||||
}
|
||||
component.BaliseStateType.SetValue(entry, component.BaliseState{
|
||||
ValidTelegram: req.Telegram,
|
||||
})
|
||||
return nil
|
||||
}
|
||||
|
||||
// BaliseTelegramReset 重置应答器报文
|
||||
func BaliseTelegramReset(simulation *VerifySimulation, req *dto.BaliseReqDto) error {
|
||||
uid := QueryMapUidMapByType(req.MapId, &graphicData.Transponder{})[req.BaliseId].Uid
|
||||
entry, ok := entity.GetEntityByUid(simulation.World, uid)
|
||||
if !ok {
|
||||
return sys_error.New(fmt.Sprintf("没有[mapId:%d id:%d]的应答器", req.MapId, req.BaliseId))
|
||||
}
|
||||
worldData := entity.GetWorldData(simulation.World)
|
||||
transponder := worldData.Repo.FindTransponder(uid)
|
||||
component.BaliseStateType.SetValue(entry, component.BaliseState{
|
||||
ValidTelegram: transponder.FixedTelegram(),
|
||||
})
|
||||
return nil
|
||||
}
|
||||
|
||||
// BaliseReset 重置应答器所有状态
|
||||
func BaliseReset(simulation *VerifySimulation, req *dto.BaliseReqDto) error {
|
||||
err := BaliseTelegramReset(simulation, req)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = BalisePositionReset(simulation, req)
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ type VerifySimulation struct {
|
|||
Repo *repository.Repository
|
||||
//Rtss仿真世界的
|
||||
World ecs.World
|
||||
//设备UID映射
|
||||
//设备UID映射 key-uid
|
||||
uidMap map[string]*elementIdStructure
|
||||
// 运行环境配置
|
||||
runConfig *config.ThridPartyConfig
|
||||
|
@ -791,7 +791,7 @@ func buildAndRelateElectronicComponent(repo *proto.Repository, relayGi *graphicD
|
|||
// continue
|
||||
// }
|
||||
// d.Components = append(d.Components, &proto.ElectronicComponent{
|
||||
// TransponderId: relayUidStructure.RelayIds[relayId].Uid,
|
||||
// BaliseId: relayUidStructure.RelayIds[relayId].Uid,
|
||||
// DeviceType: proto.DeviceType_DeviceType_Relay,
|
||||
// })
|
||||
// }
|
||||
|
|
Loading…
Reference in New Issue