摁钮旁路及旁路复位还原

This commit is contained in:
tiger_zhou 2024-02-06 10:49:46 +08:00
parent 93dba75d9b
commit 9103eeaa08
8 changed files with 34 additions and 395 deletions

View File

@ -47,7 +47,7 @@ func InitSimulationRouter(api *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddle
authed.PUT("/balise/telegram/modify", baliseTelegramModify) authed.PUT("/balise/telegram/modify", baliseTelegramModify)
authed.PUT("/balise/telegram/reset", baliseTelegramReset) authed.PUT("/balise/telegram/reset", baliseTelegramReset)
authed.PUT("/balise/reset", baliseReset) authed.PUT("/balise/reset", baliseReset)
authed.POST("/bypass/operation", bypassBtnOrKeyOperation) //authed.POST("/bypass/operation", bypassBtnOrKeyOperation)
// 初始化地图信息 // 初始化地图信息
initPublishMapInfo() initPublishMapInfo()
@ -333,36 +333,6 @@ func removeTrain(c *gin.Context) {
c.JSON(http.StatusOK, "ok") c.JSON(http.StatusOK, "ok")
} }
// ATS测试仿真-摁钮,钥匙设置旁路
//
// @Summary ATS测试仿真-摁钮,钥匙设置旁路
//
// @Security JwtAuth
//
// @Description ATS测试仿真-移除列车
// @Tags ATS测试仿真Api
// @Accept json
// @Produce json
// @Param Authorization header string true "JWT Token"
// @Param BypassOperationReq body request_proto.BypassOperationReq true "ATS测试仿真-摁钮,钥匙设置旁路"
//
// @Success 200 {object} string
// @Failure 500 {object} dto.ErrorDto
// @Router /api/v1/simulation/bypass/operation [post]
func bypassBtnOrKeyOperation(c *gin.Context) {
req := &request_proto.BypassOperationReq{}
if err := c.ShouldBind(&req); err != nil {
panic(sys_error.New("摁钮旁路参数,请求参数异常", err))
}
slog.Debug("ATS测试仿真-摁钮旁路参数,请求:", req)
simulation := checkDeviceDataAndReturn(req.SimulationId)
err := memory.ChangeBtnAndkeyBypass(simulation, req)
if err != nil {
panic(sys_error.New("旁路设置失败"))
}
c.JSON(http.StatusOK, "ok")
}
// 获取ATS测试-操作道岔 // 获取ATS测试-操作道岔
// //
// @Summary 获取ATS测试-操作道岔 // @Summary 获取ATS测试-操作道岔

View File

@ -3506,58 +3506,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": { "/api/v1/simulation/check/data": {
"post": { "post": {
"security": [ "security": [
@ -6136,70 +6084,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": { "request_proto.PointsOperationReq": {
"type": "object", "type": "object",
"properties": { "properties": {

View File

@ -3500,58 +3500,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": { "/api/v1/simulation/check/data": {
"post": { "post": {
"security": [ "security": [
@ -6130,70 +6078,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": { "request_proto.PointsOperationReq": {
"type": "object", "type": "object",
"properties": { "properties": {

View File

@ -785,53 +785,6 @@ definitions:
description: 数据类型 description: 数据类型
type: integer type: integer
type: object 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: request_proto.Points_Force:
enum: enum:
- 0 - 0
@ -3291,39 +3244,6 @@ paths:
summary: 重置应答器报文 summary: 重置应答器报文
tags: tags:
- ATS测试仿真Api - 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: /api/v1/simulation/check/data:
post: post:
consumes: consumes:

View File

@ -2595,7 +2595,6 @@ type ButtonState struct {
Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Down bool `protobuf:"varint,2,opt,name=down,proto3" json:"down,omitempty"` Down bool `protobuf:"varint,2,opt,name=down,proto3" json:"down,omitempty"`
Active bool `protobuf:"varint,3,opt,name=active,proto3" json:"active,omitempty"` // 带灯的按钮 Active bool `protobuf:"varint,3,opt,name=active,proto3" json:"active,omitempty"` // 带灯的按钮
Bypass bool `protobuf:"varint,4,opt,name=bypass,proto3" json:"bypass,omitempty"` //摁钮,钥匙 是否旁路
} }
func (x *ButtonState) Reset() { func (x *ButtonState) Reset() {
@ -2651,13 +2650,6 @@ func (x *ButtonState) GetActive() bool {
return false return false
} }
func (x *ButtonState) GetBypass() bool {
if x != nil {
return x.Bypass
}
return false
}
// 警铃状态 // 警铃状态
type AlarmState struct { type AlarmState struct {
state protoimpl.MessageState state protoimpl.MessageState
@ -2929,8 +2921,7 @@ type KeyState struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Gear int32 `protobuf:"varint,2,opt,name=gear,proto3" json:"gear,omitempty"` Gear int32 `protobuf:"varint,2,opt,name=gear,proto3" json:"gear,omitempty"` // bool bypass = 3; //摁钮,钥匙 是否旁路
Bypass bool `protobuf:"varint,3,opt,name=bypass,proto3" json:"bypass,omitempty"` //摁钮,钥匙 是否旁路
} }
func (x *KeyState) Reset() { func (x *KeyState) Reset() {
@ -2979,13 +2970,6 @@ func (x *KeyState) GetGear() int32 {
return 0 return 0
} }
func (x *KeyState) GetBypass() bool {
if x != nil {
return x.Bypass
}
return false
}
// 战场图门控箱继电器状态 // 战场图门控箱继电器状态
type MkxJState struct { type MkxJState struct {
state protoimpl.MessageState state protoimpl.MessageState
@ -4184,40 +4168,37 @@ var file_device_state_proto_rawDesc = []byte{
0x69, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x78, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x02, 0x69, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x78, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x02,
0x78, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x78, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18,
0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x22, 0x61, 0x0a, 0x0b, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x22, 0x49, 0x0a, 0x0b,
0x42, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x42, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x64,
0x6f, 0x77, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x64, 0x6f, 0x77, 0x6e, 0x12, 0x6f, 0x77, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x64, 0x6f, 0x77, 0x6e, 0x12,
0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52,
0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x79, 0x70, 0x61, 0x73, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x22, 0x34, 0x0a, 0x0a, 0x41, 0x6c, 0x61, 0x72, 0x6d,
0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x62, 0x79, 0x70, 0x61, 0x73, 0x73, 0x22, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
0x34, 0x0a, 0x0a, 0x41, 0x6c, 0x61, 0x72, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0e, 0x0a, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18,
0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x22, 0x34, 0x0a,
0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x61, 0x0a, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69,
0x63, 0x74, 0x69, 0x76, 0x65, 0x22, 0x34, 0x0a, 0x0a, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x53, 0x74, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x61,
0x61, 0x74, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x61, 0x63, 0x74,
0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, 0x02, 0x20, 0x69, 0x76, 0x65, 0x22, 0xa0, 0x01, 0x0a, 0x08, 0x50, 0x73, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65,
0x01, 0x28, 0x08, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x22, 0xa0, 0x01, 0x0a, 0x08, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64,
0x50, 0x73, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x12, 0x2d, 0x0a, 0x09, 0x61, 0x73, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20,
0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2d, 0x0a, 0x09, 0x61, 0x73, 0x64, 0x53, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x41, 0x73, 0x64, 0x53,
0x74, 0x61, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x73, 0x74, 0x74, 0x61, 0x74, 0x65, 0x52, 0x09, 0x61, 0x73, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x73, 0x12,
0x61, 0x74, 0x65, 0x2e, 0x41, 0x73, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x09, 0x61, 0x73, 0x10, 0x0a, 0x03, 0x6d, 0x67, 0x6a, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x6d, 0x67,
0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x67, 0x6a, 0x18, 0x03, 0x6a, 0x12, 0x27, 0x0a, 0x05, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b,
0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x6d, 0x67, 0x6a, 0x12, 0x27, 0x0a, 0x05, 0x70, 0x61, 0x72, 0x32, 0x11, 0x2e, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x50, 0x73, 0x64, 0x50, 0x61,
0x61, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x72, 0x65, 0x71, 0x75, 0x65, 0x72, 0x61, 0x6d, 0x52, 0x05, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x62,
0x73, 0x74, 0x2e, 0x50, 0x73, 0x64, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x52, 0x05, 0x70, 0x61, 0x72, 0x73, 0x74, 0x61, 0x63, 0x6c, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x6f, 0x62,
0x61, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x62, 0x73, 0x74, 0x61, 0x63, 0x6c, 0x65, 0x18, 0x05, 0x73, 0x74, 0x61, 0x63, 0x6c, 0x65, 0x22, 0x58, 0x0a, 0x08, 0x41, 0x73, 0x64, 0x53, 0x74, 0x61,
0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x6f, 0x62, 0x73, 0x74, 0x61, 0x63, 0x6c, 0x65, 0x22, 0x58, 0x74, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05,
0x0a, 0x08, 0x41, 0x73, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x6d, 0x64, 0x77, 0x18, 0x02,
0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x6b, 0x6d, 0x64, 0x77, 0x12, 0x12, 0x0a, 0x04, 0x67, 0x6d,
0x0a, 0x04, 0x6b, 0x6d, 0x64, 0x77, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x6b, 0x6d, 0x64, 0x77, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x67, 0x6d, 0x64, 0x77, 0x12, 0x10,
0x64, 0x77, 0x12, 0x12, 0x0a, 0x04, 0x67, 0x6d, 0x64, 0x77, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x0a, 0x03, 0x6d, 0x67, 0x6a, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x6d, 0x67, 0x6a,
0x52, 0x04, 0x67, 0x6d, 0x64, 0x77, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x67, 0x6a, 0x18, 0x04, 0x20, 0x22, 0x2e, 0x0a, 0x08, 0x4b, 0x65, 0x79, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0e, 0x0a, 0x02,
0x01, 0x28, 0x08, 0x52, 0x03, 0x6d, 0x67, 0x6a, 0x22, 0x46, 0x0a, 0x08, 0x4b, 0x65, 0x79, 0x53, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04,
0x74, 0x61, 0x74, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x67, 0x65, 0x61, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x67, 0x65, 0x61, 0x72,
0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x67, 0x65, 0x61, 0x72, 0x18, 0x02, 0x20, 0x01,
0x28, 0x05, 0x52, 0x04, 0x67, 0x65, 0x61, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x79, 0x70, 0x61,
0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x62, 0x79, 0x70, 0x61, 0x73, 0x73,
0x22, 0x52, 0x0a, 0x09, 0x4d, 0x6b, 0x78, 0x4a, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x12, 0x0a, 0x22, 0x52, 0x0a, 0x09, 0x4d, 0x6b, 0x78, 0x4a, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x12, 0x0a,
0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64,
0x65, 0x12, 0x31, 0x0a, 0x0a, 0x72, 0x65, 0x70, 0x6c, 0x79, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x65, 0x12, 0x31, 0x0a, 0x0a, 0x72, 0x65, 0x70, 0x6c, 0x79, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18,

View File

@ -87,7 +87,7 @@ func getIBPButtonState(id uint32, entry *ecs.Entry) *state_proto.ButtonState {
status := &state_proto.ButtonState{Id: id} status := &state_proto.ButtonState{Id: id}
bit := component.BitStateType.Get(entry) bit := component.BitStateType.Get(entry)
status.Down = bit.Val status.Down = bit.Val
status.Bypass = bit.BypassEnable //status.Bypass = bit.BypassEnable
// 如果按钮包含灯 // 如果按钮包含灯
if entry.HasComponent(component.SingleLightType) { if entry.HasComponent(component.SingleLightType) {
lightComponent := component.SingleLightType.Get(entry) lightComponent := component.SingleLightType.Get(entry)
@ -142,7 +142,7 @@ func collectIBPKeyState(world ecs.World, stationUid string, uidsMap *memory.IBPU
} }
if entry.HasComponent(component.KeyTag) { if entry.HasComponent(component.KeyTag) {
gearState := component.GearStateType.Get(entry) gearState := component.GearStateType.Get(entry)
states = append(states, &state_proto.KeyState{Bypass: gearState.BypassEnable, Id: did, Gear: gearState.Val}) states = append(states, &state_proto.KeyState{ /*Bypass: gearState.BypassEnable,*/ Id: did, Gear: gearState.Val})
} }
} }
return states, nil return states, nil

View File

@ -55,7 +55,7 @@ func collectGateBoxPSLState(world ecs.World, mapId int32, box *data_proto.GatedB
Id: btnUidMap[component.UidType.Get(btn).Id], Id: btnUidMap[component.UidType.Get(btn).Id],
Down: btnState.Val, Down: btnState.Val,
Active: btnState.Val, Active: btnState.Val,
Bypass: btnState.BypassEnable, //Bypass: btnState.BypassEnable,
}) })
} }
} }

View File

@ -204,7 +204,7 @@ func collectStationButtonStates(world ecs.World, mapId int32) ([]*state_proto.Bu
} }
if entry.HasComponent(component.ButtonTag) { // 按钮 if entry.HasComponent(component.ButtonTag) { // 按钮
bit := component.BitStateType.Get(entry) bit := component.BitStateType.Get(entry)
btnStateArr = append(btnStateArr, &state_proto.ButtonState{Bypass: bit.BypassEnable, Id: u.CommonId, Down: bit.Val}) btnStateArr = append(btnStateArr, &state_proto.ButtonState{ /*Bypass: bit.BypassEnable,*/ Id: u.CommonId, Down: bit.Val})
} }
} }
return btnStateArr, nil return btnStateArr, nil