摁钮旁路及旁路复位还原
This commit is contained in:
parent
d6057f5347
commit
b525015853
116
docs/docs.go
116
docs/docs.go
|
@ -3604,58 +3604,6 @@ const docTemplate = `{
|
|||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/simulation/bypass/operation": {
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
"JwtAuth": []
|
||||
}
|
||||
],
|
||||
"description": "ATS测试仿真-移除列车",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"ATS测试仿真Api"
|
||||
],
|
||||
"summary": "ATS测试仿真-摁钮,钥匙设置旁路",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "JWT Token",
|
||||
"name": "Authorization",
|
||||
"in": "header",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"description": "ATS测试仿真-摁钮,钥匙设置旁路",
|
||||
"name": "BypassOperationReq",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/request_proto.BypassOperationReq"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/dto.ErrorDto"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/simulation/check/data": {
|
||||
"post": {
|
||||
"security": [
|
||||
|
@ -6234,70 +6182,6 @@ const docTemplate = `{
|
|||
}
|
||||
}
|
||||
},
|
||||
"request_proto.BypassOperationReq": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"btnType": {
|
||||
"$ref": "#/definitions/request_proto.BypassOperationReq_BtnType"
|
||||
},
|
||||
"deviceCode": {
|
||||
"description": "设备code",
|
||||
"type": "string"
|
||||
},
|
||||
"deviceId": {
|
||||
"description": "设备id",
|
||||
"type": "integer"
|
||||
},
|
||||
"gateBoxId": {
|
||||
"type": "integer"
|
||||
},
|
||||
"mapId": {
|
||||
"description": "图id",
|
||||
"type": "integer"
|
||||
},
|
||||
"operation": {
|
||||
"$ref": "#/definitions/request_proto.BypassOperationReq_Operation"
|
||||
},
|
||||
"simulationId": {
|
||||
"description": "仿真id",
|
||||
"type": "string"
|
||||
},
|
||||
"stationId": {
|
||||
"description": "车站id",
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"request_proto.BypassOperationReq_BtnType": {
|
||||
"type": "integer",
|
||||
"enum": [
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
3
|
||||
],
|
||||
"x-enum-varnames": [
|
||||
"BypassOperationReq_esb_btn",
|
||||
"BypassOperationReq_ibp_btn",
|
||||
"BypassOperationReq_ibp_key",
|
||||
"BypassOperationReq_pls_btn"
|
||||
]
|
||||
},
|
||||
"request_proto.BypassOperationReq_Operation": {
|
||||
"type": "integer",
|
||||
"enum": [
|
||||
0,
|
||||
1
|
||||
],
|
||||
"x-enum-comments": {
|
||||
"BypassOperationReq_bypass": "旁路",
|
||||
"BypassOperationReq_bypass_reset": "旁路重置"
|
||||
},
|
||||
"x-enum-varnames": [
|
||||
"BypassOperationReq_bypass",
|
||||
"BypassOperationReq_bypass_reset"
|
||||
]
|
||||
},
|
||||
"request_proto.PointsOperationReq": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
|
@ -3598,58 +3598,6 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/simulation/bypass/operation": {
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
"JwtAuth": []
|
||||
}
|
||||
],
|
||||
"description": "ATS测试仿真-移除列车",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"ATS测试仿真Api"
|
||||
],
|
||||
"summary": "ATS测试仿真-摁钮,钥匙设置旁路",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "JWT Token",
|
||||
"name": "Authorization",
|
||||
"in": "header",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"description": "ATS测试仿真-摁钮,钥匙设置旁路",
|
||||
"name": "BypassOperationReq",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/request_proto.BypassOperationReq"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/dto.ErrorDto"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/v1/simulation/check/data": {
|
||||
"post": {
|
||||
"security": [
|
||||
|
@ -6228,70 +6176,6 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"request_proto.BypassOperationReq": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"btnType": {
|
||||
"$ref": "#/definitions/request_proto.BypassOperationReq_BtnType"
|
||||
},
|
||||
"deviceCode": {
|
||||
"description": "设备code",
|
||||
"type": "string"
|
||||
},
|
||||
"deviceId": {
|
||||
"description": "设备id",
|
||||
"type": "integer"
|
||||
},
|
||||
"gateBoxId": {
|
||||
"type": "integer"
|
||||
},
|
||||
"mapId": {
|
||||
"description": "图id",
|
||||
"type": "integer"
|
||||
},
|
||||
"operation": {
|
||||
"$ref": "#/definitions/request_proto.BypassOperationReq_Operation"
|
||||
},
|
||||
"simulationId": {
|
||||
"description": "仿真id",
|
||||
"type": "string"
|
||||
},
|
||||
"stationId": {
|
||||
"description": "车站id",
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"request_proto.BypassOperationReq_BtnType": {
|
||||
"type": "integer",
|
||||
"enum": [
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
3
|
||||
],
|
||||
"x-enum-varnames": [
|
||||
"BypassOperationReq_esb_btn",
|
||||
"BypassOperationReq_ibp_btn",
|
||||
"BypassOperationReq_ibp_key",
|
||||
"BypassOperationReq_pls_btn"
|
||||
]
|
||||
},
|
||||
"request_proto.BypassOperationReq_Operation": {
|
||||
"type": "integer",
|
||||
"enum": [
|
||||
0,
|
||||
1
|
||||
],
|
||||
"x-enum-comments": {
|
||||
"BypassOperationReq_bypass": "旁路",
|
||||
"BypassOperationReq_bypass_reset": "旁路重置"
|
||||
},
|
||||
"x-enum-varnames": [
|
||||
"BypassOperationReq_bypass",
|
||||
"BypassOperationReq_bypass_reset"
|
||||
]
|
||||
},
|
||||
"request_proto.PointsOperationReq": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
|
|
@ -785,53 +785,6 @@ definitions:
|
|||
description: 数据类型
|
||||
type: integer
|
||||
type: object
|
||||
request_proto.BypassOperationReq:
|
||||
properties:
|
||||
btnType:
|
||||
$ref: '#/definitions/request_proto.BypassOperationReq_BtnType'
|
||||
deviceCode:
|
||||
description: 设备code
|
||||
type: string
|
||||
deviceId:
|
||||
description: 设备id
|
||||
type: integer
|
||||
gateBoxId:
|
||||
type: integer
|
||||
mapId:
|
||||
description: 图id
|
||||
type: integer
|
||||
operation:
|
||||
$ref: '#/definitions/request_proto.BypassOperationReq_Operation'
|
||||
simulationId:
|
||||
description: 仿真id
|
||||
type: string
|
||||
stationId:
|
||||
description: 车站id
|
||||
type: integer
|
||||
type: object
|
||||
request_proto.BypassOperationReq_BtnType:
|
||||
enum:
|
||||
- 0
|
||||
- 1
|
||||
- 2
|
||||
- 3
|
||||
type: integer
|
||||
x-enum-varnames:
|
||||
- BypassOperationReq_esb_btn
|
||||
- BypassOperationReq_ibp_btn
|
||||
- BypassOperationReq_ibp_key
|
||||
- BypassOperationReq_pls_btn
|
||||
request_proto.BypassOperationReq_Operation:
|
||||
enum:
|
||||
- 0
|
||||
- 1
|
||||
type: integer
|
||||
x-enum-comments:
|
||||
BypassOperationReq_bypass: 旁路
|
||||
BypassOperationReq_bypass_reset: 旁路重置
|
||||
x-enum-varnames:
|
||||
- BypassOperationReq_bypass
|
||||
- BypassOperationReq_bypass_reset
|
||||
request_proto.Points_Force:
|
||||
enum:
|
||||
- 0
|
||||
|
@ -3353,39 +3306,6 @@ paths:
|
|||
summary: 应答器报文停止发送
|
||||
tags:
|
||||
- ATS测试仿真Api
|
||||
/api/v1/simulation/bypass/operation:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
description: ATS测试仿真-移除列车
|
||||
parameters:
|
||||
- description: JWT Token
|
||||
in: header
|
||||
name: Authorization
|
||||
required: true
|
||||
type: string
|
||||
- description: ATS测试仿真-摁钮,钥匙设置旁路
|
||||
in: body
|
||||
name: BypassOperationReq
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/request_proto.BypassOperationReq'
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
type: string
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/dto.ErrorDto'
|
||||
security:
|
||||
- JwtAuth: []
|
||||
summary: ATS测试仿真-摁钮,钥匙设置旁路
|
||||
tags:
|
||||
- ATS测试仿真Api
|
||||
/api/v1/simulation/check/data:
|
||||
post:
|
||||
consumes:
|
||||
|
|
|
@ -1,51 +0,0 @@
|
|||
package memory
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"joylink.club/bj-rtsts-server/dto/data_proto"
|
||||
"joylink.club/bj-rtsts-server/dto/request_proto"
|
||||
"joylink.club/rtsssimulation/fi"
|
||||
)
|
||||
|
||||
func ChangeBtnAndkeyBypass(sim *VerifySimulation, req *request_proto.BypassOperationReq) error {
|
||||
|
||||
switch req.BtnType {
|
||||
case request_proto.BypassOperationReq_esb_btn:
|
||||
uid := QueryUidByMidAndComId(req.MapId, req.DeviceId, &data_proto.EsbButton{})
|
||||
fi.SetBypassBtn(sim.World, uid, req.Operation)
|
||||
return nil
|
||||
case request_proto.BypassOperationReq_ibp_btn:
|
||||
uidMap, err := getIbpUidByMapIdAndStationId(req.MapId, req.StationId)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if uidMap.IbpButtonIds[req.DeviceId] == nil {
|
||||
return fmt.Errorf("车站【%d】按钮【%d】UID不存在", req.StationId, req.DeviceId)
|
||||
}
|
||||
stationUid := QueryUidByMidAndComId(req.MapId, req.StationId, &data_proto.Station{})
|
||||
devUid := stationUid + "_" + uidMap.IbpButtonIds[req.DeviceId].Uid
|
||||
|
||||
fi.SetBypassBtn(sim.World, devUid, req.Operation)
|
||||
return nil
|
||||
case request_proto.BypassOperationReq_ibp_key:
|
||||
uidMap, err := getIbpUidByMapIdAndStationId(req.MapId, req.StationId)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if uidMap.IbpKeyIds[req.DeviceId] == nil {
|
||||
return fmt.Errorf("车站【%d】钥匙【%d】UID不存在", req.StationId, req.DeviceId)
|
||||
}
|
||||
stationUid := QueryUidByMidAndComId(req.MapId, req.StationId, &data_proto.Station{})
|
||||
devUid := stationUid + "_" + uidMap.IbpKeyIds[req.DeviceId].Uid
|
||||
fi.SetBypassSwitchKey(sim.World, devUid, req.Operation)
|
||||
return nil
|
||||
case request_proto.BypassOperationReq_pls_btn:
|
||||
uid := QueryUidStructure[*StationUidStructure](req.MapId)
|
||||
gateBoxUid := uid.GateBoxIds[req.GateBoxId].Uid
|
||||
devUid := fmt.Sprintf("%v_%v", gateBoxUid, req.DeviceCode)
|
||||
fi.SetBypassBtn(sim.World, devUid, req.Operation)
|
||||
return nil
|
||||
default:
|
||||
return fmt.Errorf("设置旁路不能确定的类型[%v]", req.BtnType)
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue