This commit is contained in:
soul-walker 2024-03-27 16:44:23 +08:00
commit ffd989b13b
21 changed files with 2852 additions and 1905 deletions

View File

@ -47,12 +47,13 @@ func InitSimulationRouter(api *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddle
authed.POST("/psl/operation", pslBtnOperation) //1 authed.POST("/psl/operation", pslBtnOperation) //1
authed.POST("/psd/operation", psdOperation) authed.POST("/psd/operation", psdOperation)
authed.PUT("/balise/position/modify", balisePositionModify) authed.PUT("/balise/position/modify", balisePositionModify)
authed.PUT("/balise/position/reset", transponderPositionReset) authed.PUT("/balise/position/reset", balisePositionReset)
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/telegram/stop", baliseTelegramStop) authed.PUT("/balise/telegram/stop", baliseTelegramStop)
authed.PUT("/balise/telegram/send", baliseTelegramSend) authed.PUT("/balise/telegram/send", baliseTelegramSend)
authed.PUT("/balise/reset", baliseReset) authed.PUT("/balise/reset", baliseReset)
authed.PUT("/ckm/operation", ckmOperation)
//authed.POST("/bypass/operation", bypassBtnOrKeyOperation) //authed.POST("/bypass/operation", bypassBtnOrKeyOperation)
// 初始化地图信息 // 初始化地图信息
@ -613,7 +614,10 @@ func pslBtnOperation(c *gin.Context) {
} }
simulation := checkDeviceDataAndReturn(req.SimulationId) simulation := checkDeviceDataAndReturn(req.SimulationId)
slog.Info("传入状态参数", req) slog.Info("传入状态参数", req)
memory.ChangePSLButtonState(simulation, req.MapId, req.PslId, req.ButtonCode, req.Down) var err *sys_error.BusinessError = memory.ChangePSLButtonState(simulation, req.MapId, req.PslId, req.ButtonCode, req.Down)
if err != nil {
panic(err)
}
c.JSON(http.StatusOK, "ok") c.JSON(http.StatusOK, "ok")
} }
@ -744,7 +748,7 @@ func balisePositionModify(c *gin.Context) {
// @Success 200 {object} string // @Success 200 {object} string
// @Failure 500 {object} dto.ErrorDto // @Failure 500 {object} dto.ErrorDto
// @Router /api/v1/simulation/balise/position/reset [put] // @Router /api/v1/simulation/balise/position/reset [put]
func transponderPositionReset(c *gin.Context) { func balisePositionReset(c *gin.Context) {
req := &dto.BaliseReqDto{} req := &dto.BaliseReqDto{}
if err := c.ShouldBind(&req); err != nil { if err := c.ShouldBind(&req); err != nil {
panic(sys_error.New("应答器复位操作失败,请求参数异常", err)) panic(sys_error.New("应答器复位操作失败,请求参数异常", err))
@ -903,6 +907,34 @@ func baliseReset(c *gin.Context) {
c.JSON(http.StatusOK, "ok") c.JSON(http.StatusOK, "ok")
} }
// 车库门操作
//
// @Summary 车库门操作
//
// @Security JwtAuth
//
// @Description 车库门操作
// @Tags ATS测试仿真Api
// @Accept json
// @Param Authorization header string true "JWT Token"
// @Param CkmOperationReq body request_proto.CkmOperationReq true "车库门操作"
//
// @Success 200 {object} string
// @Failure 500 {object} dto.ErrorDto
// @Router /api/v1/simulation/ckm/operation [put]
func ckmOperation(c *gin.Context) {
req := &request_proto.CkmOperationReq{}
if err := c.ShouldBind(&req); err != nil {
panic(dto.ErrorDto{Code: dto.ArgumentParseError, Message: err.Error()})
}
simulation := checkDeviceDataAndReturn(req.SimulationId)
var err *sys_error.BusinessError = memory.CkmOperation(simulation, req)
if err != nil {
panic(err)
}
c.JSON(http.StatusOK, "ok")
}
// 获取仿真设备数据并返回 // 获取仿真设备数据并返回
func checkDeviceDataAndReturn(simId string) *memory.VerifySimulation { func checkDeviceDataAndReturn(simId string) *memory.VerifySimulation {
deviceMemory := ts.FindSimulation(simId) deviceMemory := ts.FindSimulation(simId)

View File

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.32.0 // protoc-gen-go v1.33.0
// protoc v4.23.1 // protoc v4.23.1
// source: common_data.proto // source: common_data.proto

View File

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.32.0 // protoc-gen-go v1.33.0
// protoc v4.23.1 // protoc v4.23.1
// source: ibpGraphics.proto // source: ibpGraphics.proto

View File

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.32.0 // protoc-gen-go v1.33.0
// protoc v4.23.1 // protoc v4.23.1
// source: picture.proto // source: picture.proto

View File

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.32.0 // protoc-gen-go v1.33.0
// protoc v4.23.1 // protoc v4.23.1
// source: pslGraphics.proto // source: pslGraphics.proto

View File

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.32.0 // protoc-gen-go v1.33.0
// protoc v4.23.1 // protoc v4.23.1
// source: relayCabinetLayoutGraphics.proto // source: relayCabinetLayoutGraphics.proto

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.32.0 // protoc-gen-go v1.33.0
// protoc v4.23.1 // protoc v4.23.1
// source: tccGraphics.proto // source: tccGraphics.proto
@ -20,50 +20,50 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
) )
type TccKeyType int32 type TccKey_TccKeyType int32
const ( const (
TccKeyType_driverControllerActivationClint TccKeyType = 0 //司控器激活端 TccKey_driverControllerActivationClint TccKey_TccKeyType = 0 //司控器激活端
TccKeyType_frontAndRearDirectionalControl TccKeyType = 1 //前后方向控制 TccKey_frontAndRearDirectionalControl TccKey_TccKeyType = 1 //前后方向控制
) )
// Enum value maps for TccKeyType. // Enum value maps for TccKey_TccKeyType.
var ( var (
TccKeyType_name = map[int32]string{ TccKey_TccKeyType_name = map[int32]string{
0: "driverControllerActivationClint", 0: "driverControllerActivationClint",
1: "frontAndRearDirectionalControl", 1: "frontAndRearDirectionalControl",
} }
TccKeyType_value = map[string]int32{ TccKey_TccKeyType_value = map[string]int32{
"driverControllerActivationClint": 0, "driverControllerActivationClint": 0,
"frontAndRearDirectionalControl": 1, "frontAndRearDirectionalControl": 1,
} }
) )
func (x TccKeyType) Enum() *TccKeyType { func (x TccKey_TccKeyType) Enum() *TccKey_TccKeyType {
p := new(TccKeyType) p := new(TccKey_TccKeyType)
*p = x *p = x
return p return p
} }
func (x TccKeyType) String() string { func (x TccKey_TccKeyType) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
} }
func (TccKeyType) Descriptor() protoreflect.EnumDescriptor { func (TccKey_TccKeyType) Descriptor() protoreflect.EnumDescriptor {
return file_tccGraphics_proto_enumTypes[0].Descriptor() return file_tccGraphics_proto_enumTypes[0].Descriptor()
} }
func (TccKeyType) Type() protoreflect.EnumType { func (TccKey_TccKeyType) Type() protoreflect.EnumType {
return &file_tccGraphics_proto_enumTypes[0] return &file_tccGraphics_proto_enumTypes[0]
} }
func (x TccKeyType) Number() protoreflect.EnumNumber { func (x TccKey_TccKeyType) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x) return protoreflect.EnumNumber(x)
} }
// Deprecated: Use TccKeyType.Descriptor instead. // Deprecated: Use TccKey_TccKeyType.Descriptor instead.
func (TccKeyType) EnumDescriptor() ([]byte, []int) { func (TccKey_TccKeyType) EnumDescriptor() ([]byte, []int) {
return file_tccGraphics_proto_rawDescGZIP(), []int{0} return file_tccGraphics_proto_rawDescGZIP(), []int{3, 0}
} }
type TccGraphicStorage struct { type TccGraphicStorage struct {
@ -295,9 +295,9 @@ type TccKey struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Common *CommonInfo `protobuf:"bytes,1,opt,name=common,proto3" json:"common,omitempty"` Common *CommonInfo `protobuf:"bytes,1,opt,name=common,proto3" json:"common,omitempty"`
Code string `protobuf:"bytes,2,opt,name=code,proto3" json:"code,omitempty"` Code string `protobuf:"bytes,2,opt,name=code,proto3" json:"code,omitempty"`
Type TccKeyType `protobuf:"varint,3,opt,name=type,proto3,enum=tccGraphicData.TccKeyType" json:"type,omitempty"` Type TccKey_TccKeyType `protobuf:"varint,3,opt,name=type,proto3,enum=tccGraphicData.TccKey_TccKeyType" json:"type,omitempty"`
} }
func (x *TccKey) Reset() { func (x *TccKey) Reset() {
@ -346,11 +346,11 @@ func (x *TccKey) GetCode() string {
return "" return ""
} }
func (x *TccKey) GetType() TccKeyType { func (x *TccKey) GetType() TccKey_TccKeyType {
if x != nil { if x != nil {
return x.Type return x.Type
} }
return TccKeyType_driverControllerActivationClint return TccKey_driverControllerActivationClint
} }
// * TCC手柄 // * TCC手柄
@ -451,28 +451,29 @@ var file_tccGraphics_proto_rawDesc = []byte{
0x14, 0x0a, 0x05, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,
0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x6f, 0x6e, 0x74, 0x53, 0x69, 0x7a, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x6f, 0x6e, 0x74, 0x53, 0x69, 0x7a,
0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x66, 0x6f, 0x6e, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x66, 0x6f, 0x6e, 0x74, 0x53, 0x69, 0x7a,
0x65, 0x22, 0x7d, 0x0a, 0x06, 0x54, 0x63, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x2f, 0x0a, 0x06, 0x63, 0x65, 0x22, 0xdb, 0x01, 0x0a, 0x06, 0x54, 0x63, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x2f, 0x0a, 0x06,
0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x72, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67,
0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f,
0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x12, 0x0a,
0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64,
0x12, 0x2e, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x65, 0x12, 0x35, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32,
0x2e, 0x74, 0x63, 0x63, 0x47, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x21, 0x2e, 0x74, 0x63, 0x63, 0x47, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61,
0x54, 0x63, 0x63, 0x4b, 0x65, 0x79, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x54, 0x63, 0x63, 0x4b, 0x65, 0x79, 0x2e, 0x54, 0x63, 0x63, 0x4b, 0x65, 0x79, 0x54, 0x79,
0x22, 0x50, 0x0a, 0x09, 0x54, 0x63, 0x63, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x2f, 0x0a, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x55, 0x0a, 0x0a, 0x54, 0x63, 0x63, 0x4b,
0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x65, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x23, 0x0a, 0x1f, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72,
0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61,
0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x12, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6c, 0x69, 0x6e, 0x74, 0x10, 0x00, 0x12, 0x22, 0x0a, 0x1e, 0x66,
0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x72, 0x6f, 0x6e, 0x74, 0x41, 0x6e, 0x64, 0x52, 0x65, 0x61, 0x72, 0x44, 0x69, 0x72, 0x65, 0x63,
0x64, 0x65, 0x2a, 0x55, 0x0a, 0x0a, 0x54, 0x63, 0x63, 0x4b, 0x65, 0x79, 0x54, 0x79, 0x70, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x10, 0x01, 0x22,
0x12, 0x23, 0x0a, 0x1f, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x50, 0x0a, 0x09, 0x54, 0x63, 0x63, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x2f, 0x0a, 0x06,
0x6c, 0x6c, 0x65, 0x72, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67,
0x69, 0x6e, 0x74, 0x10, 0x00, 0x12, 0x22, 0x0a, 0x1e, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x41, 0x6e, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f,
0x64, 0x52, 0x65, 0x61, 0x72, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x12, 0x0a,
0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x10, 0x01, 0x42, 0x2d, 0x5a, 0x2b, 0x6a, 0x6f, 0x79, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64,
0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x63, 0x6c, 0x75, 0x62, 0x2f, 0x62, 0x6a, 0x2d, 0x72, 0x74, 0x73, 0x65, 0x42, 0x2d, 0x5a, 0x2b, 0x6a, 0x6f, 0x79, 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x63, 0x6c, 0x75,
0x74, 0x73, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x64, 0x74, 0x6f, 0x2f, 0x64, 0x61, 0x62, 0x2f, 0x62, 0x6a, 0x2d, 0x72, 0x74, 0x73, 0x74, 0x73, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65,
0x74, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x72, 0x2f, 0x64, 0x74, 0x6f, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (
@ -490,7 +491,7 @@ func file_tccGraphics_proto_rawDescGZIP() []byte {
var file_tccGraphics_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_tccGraphics_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_tccGraphics_proto_msgTypes = make([]protoimpl.MessageInfo, 5) var file_tccGraphics_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_tccGraphics_proto_goTypes = []interface{}{ var file_tccGraphics_proto_goTypes = []interface{}{
(TccKeyType)(0), // 0: tccGraphicData.TccKeyType (TccKey_TccKeyType)(0), // 0: tccGraphicData.TccKey.TccKeyType
(*TccGraphicStorage)(nil), // 1: tccGraphicData.TccGraphicStorage (*TccGraphicStorage)(nil), // 1: tccGraphicData.TccGraphicStorage
(*TccButton)(nil), // 2: tccGraphicData.TccButton (*TccButton)(nil), // 2: tccGraphicData.TccButton
(*TccText)(nil), // 3: tccGraphicData.TccText (*TccText)(nil), // 3: tccGraphicData.TccText
@ -508,7 +509,7 @@ var file_tccGraphics_proto_depIdxs = []int32{
7, // 5: tccGraphicData.TccButton.common:type_name -> graphicData.CommonInfo 7, // 5: tccGraphicData.TccButton.common:type_name -> graphicData.CommonInfo
7, // 6: tccGraphicData.TccText.common:type_name -> graphicData.CommonInfo 7, // 6: tccGraphicData.TccText.common:type_name -> graphicData.CommonInfo
7, // 7: tccGraphicData.TccKey.common:type_name -> graphicData.CommonInfo 7, // 7: tccGraphicData.TccKey.common:type_name -> graphicData.CommonInfo
0, // 8: tccGraphicData.TccKey.type:type_name -> tccGraphicData.TccKeyType 0, // 8: tccGraphicData.TccKey.type:type_name -> tccGraphicData.TccKey.TccKeyType
7, // 9: tccGraphicData.TccHandle.common:type_name -> graphicData.CommonInfo 7, // 9: tccGraphicData.TccHandle.common:type_name -> graphicData.CommonInfo
10, // [10:10] is the sub-list for method output_type 10, // [10:10] is the sub-list for method output_type
10, // [10:10] is the sub-list for method input_type 10, // [10:10] is the sub-list for method input_type

View File

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.32.0 // protoc-gen-go v1.33.0
// protoc v4.23.1 // protoc v4.23.1
// source: request.proto // source: request.proto
@ -633,6 +633,147 @@ func (TrainControl_TrainControlType) EnumDescriptor() ([]byte, []int) {
return file_request_proto_rawDescGZIP(), []int{14, 0} return file_request_proto_rawDescGZIP(), []int{14, 0}
} }
type Ckm_Operation int32
const (
Ckm_Undefined Ckm_Operation = 0
Ckm_SetParams Ckm_Operation = 1
)
// Enum value maps for Ckm_Operation.
var (
Ckm_Operation_name = map[int32]string{
0: "Undefined",
1: "SetParams",
}
Ckm_Operation_value = map[string]int32{
"Undefined": 0,
"SetParams": 1,
}
)
func (x Ckm_Operation) Enum() *Ckm_Operation {
p := new(Ckm_Operation)
*p = x
return p
}
func (x Ckm_Operation) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (Ckm_Operation) Descriptor() protoreflect.EnumDescriptor {
return file_request_proto_enumTypes[12].Descriptor()
}
func (Ckm_Operation) Type() protoreflect.EnumType {
return &file_request_proto_enumTypes[12]
}
func (x Ckm_Operation) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use Ckm_Operation.Descriptor instead.
func (Ckm_Operation) EnumDescriptor() ([]byte, []int) {
return file_request_proto_rawDescGZIP(), []int{16, 0}
}
type Ckm_Force int32
const (
Ckm_F_NONE Ckm_Force = 0 //无强制
Ckm_F_KM Ckm_Force = 1 //强制开门
Ckm_F_GM Ckm_Force = 2 //强制关门
)
// Enum value maps for Ckm_Force.
var (
Ckm_Force_name = map[int32]string{
0: "F_NONE",
1: "F_KM",
2: "F_GM",
}
Ckm_Force_value = map[string]int32{
"F_NONE": 0,
"F_KM": 1,
"F_GM": 2,
}
)
func (x Ckm_Force) Enum() *Ckm_Force {
p := new(Ckm_Force)
*p = x
return p
}
func (x Ckm_Force) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (Ckm_Force) Descriptor() protoreflect.EnumDescriptor {
return file_request_proto_enumTypes[13].Descriptor()
}
func (Ckm_Force) Type() protoreflect.EnumType {
return &file_request_proto_enumTypes[13]
}
func (x Ckm_Force) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use Ckm_Force.Descriptor instead.
func (Ckm_Force) EnumDescriptor() ([]byte, []int) {
return file_request_proto_rawDescGZIP(), []int{16, 1}
}
type Ckm_Fault int32
const (
Ckm_FA_NONE Ckm_Fault = 0 //无故障
Ckm_FA_State_Loss Ckm_Fault = 1 //状态丢失
)
// Enum value maps for Ckm_Fault.
var (
Ckm_Fault_name = map[int32]string{
0: "FA_NONE",
1: "FA_State_Loss",
}
Ckm_Fault_value = map[string]int32{
"FA_NONE": 0,
"FA_State_Loss": 1,
}
)
func (x Ckm_Fault) Enum() *Ckm_Fault {
p := new(Ckm_Fault)
*p = x
return p
}
func (x Ckm_Fault) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (Ckm_Fault) Descriptor() protoreflect.EnumDescriptor {
return file_request_proto_enumTypes[14].Descriptor()
}
func (Ckm_Fault) Type() protoreflect.EnumType {
return &file_request_proto_enumTypes[14]
}
func (x Ckm_Fault) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use Ckm_Fault.Descriptor instead.
func (Ckm_Fault) EnumDescriptor() ([]byte, []int) {
return file_request_proto_rawDescGZIP(), []int{16, 2}
}
// 继电器 // 继电器
type Relay struct { type Relay struct {
state protoimpl.MessageState state protoimpl.MessageState
@ -1544,6 +1685,258 @@ func (x *TrainControl) GetHandler() *TrainControl_PushHandler {
return nil return nil
} }
type CkmOperationReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
SimulationId string `protobuf:"bytes,1,opt,name=simulationId,proto3" json:"simulationId,omitempty"`
MapId int32 `protobuf:"varint,2,opt,name=mapId,proto3" json:"mapId,omitempty"`
DeviceId uint32 `protobuf:"varint,3,opt,name=deviceId,proto3" json:"deviceId,omitempty"` //设备id车库门id
Operation Ckm_Operation `protobuf:"varint,4,opt,name=operation,proto3,enum=request.Ckm_Operation" json:"operation,omitempty"` //车库门操作
Param *CkmParam `protobuf:"bytes,5,opt,name=param,proto3" json:"param,omitempty"` //车库门参数在operation为SetParams时有效
}
func (x *CkmOperationReq) Reset() {
*x = CkmOperationReq{}
if protoimpl.UnsafeEnabled {
mi := &file_request_proto_msgTypes[15]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CkmOperationReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CkmOperationReq) ProtoMessage() {}
func (x *CkmOperationReq) ProtoReflect() protoreflect.Message {
mi := &file_request_proto_msgTypes[15]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CkmOperationReq.ProtoReflect.Descriptor instead.
func (*CkmOperationReq) Descriptor() ([]byte, []int) {
return file_request_proto_rawDescGZIP(), []int{15}
}
func (x *CkmOperationReq) GetSimulationId() string {
if x != nil {
return x.SimulationId
}
return ""
}
func (x *CkmOperationReq) GetMapId() int32 {
if x != nil {
return x.MapId
}
return 0
}
func (x *CkmOperationReq) GetDeviceId() uint32 {
if x != nil {
return x.DeviceId
}
return 0
}
func (x *CkmOperationReq) GetOperation() Ckm_Operation {
if x != nil {
return x.Operation
}
return Ckm_Undefined
}
func (x *CkmOperationReq) GetParam() *CkmParam {
if x != nil {
return x.Param
}
return nil
}
type Ckm struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *Ckm) Reset() {
*x = Ckm{}
if protoimpl.UnsafeEnabled {
mi := &file_request_proto_msgTypes[16]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Ckm) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Ckm) ProtoMessage() {}
func (x *Ckm) ProtoReflect() protoreflect.Message {
mi := &file_request_proto_msgTypes[16]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Ckm.ProtoReflect.Descriptor instead.
func (*Ckm) Descriptor() ([]byte, []int) {
return file_request_proto_rawDescGZIP(), []int{16}
}
type CkmParam struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Force Ckm_Force `protobuf:"varint,1,opt,name=force,proto3,enum=request.Ckm_Force" json:"force,omitempty"`
Fault Ckm_Fault `protobuf:"varint,2,opt,name=fault,proto3,enum=request.Ckm_Fault" json:"fault,omitempty"`
}
func (x *CkmParam) Reset() {
*x = CkmParam{}
if protoimpl.UnsafeEnabled {
mi := &file_request_proto_msgTypes[17]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CkmParam) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CkmParam) ProtoMessage() {}
func (x *CkmParam) ProtoReflect() protoreflect.Message {
mi := &file_request_proto_msgTypes[17]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CkmParam.ProtoReflect.Descriptor instead.
func (*CkmParam) Descriptor() ([]byte, []int) {
return file_request_proto_rawDescGZIP(), []int{17}
}
func (x *CkmParam) GetForce() Ckm_Force {
if x != nil {
return x.Force
}
return Ckm_F_NONE
}
func (x *CkmParam) GetFault() Ckm_Fault {
if x != nil {
return x.Fault
}
return Ckm_FA_NONE
}
// 车库门控制盒操作请求
type CkmBoxOperationReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
SimulationId string `protobuf:"bytes,1,opt,name=simulationId,proto3" json:"simulationId,omitempty"`
MapId int32 `protobuf:"varint,2,opt,name=mapId,proto3" json:"mapId,omitempty"`
CkmBoxId uint32 `protobuf:"varint,3,opt,name=ckmBoxId,proto3" json:"ckmBoxId,omitempty"`
ButtonCode string `protobuf:"bytes,4,opt,name=buttonCode,proto3" json:"buttonCode,omitempty"`
Down bool `protobuf:"varint,5,opt,name=down,proto3" json:"down,omitempty"` //按下/抬起
}
func (x *CkmBoxOperationReq) Reset() {
*x = CkmBoxOperationReq{}
if protoimpl.UnsafeEnabled {
mi := &file_request_proto_msgTypes[18]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CkmBoxOperationReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CkmBoxOperationReq) ProtoMessage() {}
func (x *CkmBoxOperationReq) ProtoReflect() protoreflect.Message {
mi := &file_request_proto_msgTypes[18]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CkmBoxOperationReq.ProtoReflect.Descriptor instead.
func (*CkmBoxOperationReq) Descriptor() ([]byte, []int) {
return file_request_proto_rawDescGZIP(), []int{18}
}
func (x *CkmBoxOperationReq) GetSimulationId() string {
if x != nil {
return x.SimulationId
}
return ""
}
func (x *CkmBoxOperationReq) GetMapId() int32 {
if x != nil {
return x.MapId
}
return 0
}
func (x *CkmBoxOperationReq) GetCkmBoxId() uint32 {
if x != nil {
return x.CkmBoxId
}
return 0
}
func (x *CkmBoxOperationReq) GetButtonCode() string {
if x != nil {
return x.ButtonCode
}
return ""
}
func (x *CkmBoxOperationReq) GetDown() bool {
if x != nil {
return x.Down
}
return false
}
// 紧急制动 // 紧急制动
type TrainControl_EmergentButton struct { type TrainControl_EmergentButton struct {
state protoimpl.MessageState state protoimpl.MessageState
@ -1556,7 +1949,7 @@ type TrainControl_EmergentButton struct {
func (x *TrainControl_EmergentButton) Reset() { func (x *TrainControl_EmergentButton) Reset() {
*x = TrainControl_EmergentButton{} *x = TrainControl_EmergentButton{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_request_proto_msgTypes[15] mi := &file_request_proto_msgTypes[19]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -1569,7 +1962,7 @@ func (x *TrainControl_EmergentButton) String() string {
func (*TrainControl_EmergentButton) ProtoMessage() {} func (*TrainControl_EmergentButton) ProtoMessage() {}
func (x *TrainControl_EmergentButton) ProtoReflect() protoreflect.Message { func (x *TrainControl_EmergentButton) ProtoReflect() protoreflect.Message {
mi := &file_request_proto_msgTypes[15] mi := &file_request_proto_msgTypes[19]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -1605,7 +1998,7 @@ type TrainControl_DriverKeySwitch struct {
func (x *TrainControl_DriverKeySwitch) Reset() { func (x *TrainControl_DriverKeySwitch) Reset() {
*x = TrainControl_DriverKeySwitch{} *x = TrainControl_DriverKeySwitch{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_request_proto_msgTypes[16] mi := &file_request_proto_msgTypes[20]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -1618,7 +2011,7 @@ func (x *TrainControl_DriverKeySwitch) String() string {
func (*TrainControl_DriverKeySwitch) ProtoMessage() {} func (*TrainControl_DriverKeySwitch) ProtoMessage() {}
func (x *TrainControl_DriverKeySwitch) ProtoReflect() protoreflect.Message { func (x *TrainControl_DriverKeySwitch) ProtoReflect() protoreflect.Message {
mi := &file_request_proto_msgTypes[16] mi := &file_request_proto_msgTypes[20]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -1659,7 +2052,7 @@ type TrainControl_DirectionKeySwitch struct {
func (x *TrainControl_DirectionKeySwitch) Reset() { func (x *TrainControl_DirectionKeySwitch) Reset() {
*x = TrainControl_DirectionKeySwitch{} *x = TrainControl_DirectionKeySwitch{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_request_proto_msgTypes[17] mi := &file_request_proto_msgTypes[21]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -1672,7 +2065,7 @@ func (x *TrainControl_DirectionKeySwitch) String() string {
func (*TrainControl_DirectionKeySwitch) ProtoMessage() {} func (*TrainControl_DirectionKeySwitch) ProtoMessage() {}
func (x *TrainControl_DirectionKeySwitch) ProtoReflect() protoreflect.Message { func (x *TrainControl_DirectionKeySwitch) ProtoReflect() protoreflect.Message {
mi := &file_request_proto_msgTypes[17] mi := &file_request_proto_msgTypes[21]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -1707,7 +2100,7 @@ type TrainControl_PushHandler struct {
func (x *TrainControl_PushHandler) Reset() { func (x *TrainControl_PushHandler) Reset() {
*x = TrainControl_PushHandler{} *x = TrainControl_PushHandler{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_request_proto_msgTypes[18] mi := &file_request_proto_msgTypes[22]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -1720,7 +2113,7 @@ func (x *TrainControl_PushHandler) String() string {
func (*TrainControl_PushHandler) ProtoMessage() {} func (*TrainControl_PushHandler) ProtoMessage() {}
func (x *TrainControl_PushHandler) ProtoReflect() protoreflect.Message { func (x *TrainControl_PushHandler) ProtoReflect() protoreflect.Message {
mi := &file_request_proto_msgTypes[18] mi := &file_request_proto_msgTypes[22]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -1916,13 +2309,50 @@ var file_request_proto_rawDesc = []byte{
0x0a, 0x11, 0x44, 0x52, 0x49, 0x56, 0x45, 0x52, 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x53, 0x57, 0x49, 0x0a, 0x11, 0x44, 0x52, 0x49, 0x56, 0x45, 0x52, 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x53, 0x57, 0x49,
0x54, 0x43, 0x48, 0x10, 0x01, 0x12, 0x18, 0x0a, 0x14, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x49, 0x54, 0x43, 0x48, 0x10, 0x01, 0x12, 0x18, 0x0a, 0x14, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x49,
0x4f, 0x4e, 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x53, 0x57, 0x49, 0x54, 0x43, 0x48, 0x10, 0x02, 0x12, 0x4f, 0x4e, 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x53, 0x57, 0x49, 0x54, 0x43, 0x48, 0x10, 0x02, 0x12,
0x0b, 0x0a, 0x07, 0x48, 0x41, 0x4e, 0x44, 0x4c, 0x45, 0x52, 0x10, 0x03, 0x2a, 0x26, 0x0a, 0x0a, 0x0b, 0x0a, 0x07, 0x48, 0x41, 0x4e, 0x44, 0x4c, 0x45, 0x52, 0x10, 0x03, 0x22, 0xc6, 0x01, 0x0a,
0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x4f, 0x4e, 0x0f, 0x43, 0x6b, 0x6d, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71,
0x45, 0x5f, 0x45, 0x4e, 0x44, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x54, 0x57, 0x4f, 0x5f, 0x45, 0x12, 0x22, 0x0a, 0x0c, 0x73, 0x69, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64,
0x4e, 0x44, 0x10, 0x01, 0x42, 0x30, 0x5a, 0x2e, 0x6a, 0x6f, 0x79, 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x69, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69,
0x63, 0x6c, 0x75, 0x62, 0x2f, 0x62, 0x6a, 0x2d, 0x72, 0x74, 0x73, 0x74, 0x73, 0x2d, 0x73, 0x65, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x61, 0x70, 0x49, 0x64, 0x18, 0x02, 0x20,
0x72, 0x76, 0x65, 0x72, 0x2f, 0x64, 0x74, 0x6f, 0x2f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6d, 0x61, 0x70, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65,
0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x64, 0x65,
0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, 0x34, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x72, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x2e, 0x43, 0x6b, 0x6d, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x0a, 0x05,
0x70, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x72, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x6b, 0x6d, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x52, 0x05,
0x70, 0x61, 0x72, 0x61, 0x6d, 0x22, 0x82, 0x01, 0x0a, 0x03, 0x43, 0x6b, 0x6d, 0x22, 0x29, 0x0a,
0x09, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0d, 0x0a, 0x09, 0x55, 0x6e,
0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x65, 0x74,
0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x10, 0x01, 0x22, 0x27, 0x0a, 0x05, 0x46, 0x6f, 0x72, 0x63,
0x65, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x5f, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x08, 0x0a,
0x04, 0x46, 0x5f, 0x4b, 0x4d, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x46, 0x5f, 0x47, 0x4d, 0x10,
0x02, 0x22, 0x27, 0x0a, 0x05, 0x46, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x0b, 0x0a, 0x07, 0x46, 0x41,
0x5f, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x46, 0x41, 0x5f, 0x53, 0x74,
0x61, 0x74, 0x65, 0x5f, 0x4c, 0x6f, 0x73, 0x73, 0x10, 0x01, 0x22, 0x5e, 0x0a, 0x08, 0x43, 0x6b,
0x6d, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x28, 0x0a, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18,
0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e,
0x43, 0x6b, 0x6d, 0x2e, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x52, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65,
0x12, 0x28, 0x0a, 0x05, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32,
0x12, 0x2e, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x6b, 0x6d, 0x2e, 0x46, 0x61,
0x75, 0x6c, 0x74, 0x52, 0x05, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x22, 0x9e, 0x01, 0x0a, 0x12, 0x43,
0x6b, 0x6d, 0x42, 0x6f, 0x78, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65,
0x71, 0x12, 0x22, 0x0a, 0x0c, 0x73, 0x69, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x69, 0x6d, 0x75, 0x6c, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x61, 0x70, 0x49, 0x64, 0x18, 0x02,
0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6d, 0x61, 0x70, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x63,
0x6b, 0x6d, 0x42, 0x6f, 0x78, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x63,
0x6b, 0x6d, 0x42, 0x6f, 0x78, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x62, 0x75, 0x74, 0x74, 0x6f,
0x6e, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x62, 0x75, 0x74,
0x74, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x6f, 0x77, 0x6e, 0x18,
0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x64, 0x6f, 0x77, 0x6e, 0x2a, 0x26, 0x0a, 0x0a, 0x44,
0x72, 0x69, 0x76, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x4f, 0x4e, 0x45,
0x5f, 0x45, 0x4e, 0x44, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x54, 0x57, 0x4f, 0x5f, 0x45, 0x4e,
0x44, 0x10, 0x01, 0x42, 0x30, 0x5a, 0x2e, 0x6a, 0x6f, 0x79, 0x6c, 0x69, 0x6e, 0x6b, 0x2e, 0x63,
0x6c, 0x75, 0x62, 0x2f, 0x62, 0x6a, 0x2d, 0x72, 0x74, 0x73, 0x74, 0x73, 0x2d, 0x73, 0x65, 0x72,
0x76, 0x65, 0x72, 0x2f, 0x64, 0x74, 0x6f, 0x2f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (
@ -1937,8 +2367,8 @@ func file_request_proto_rawDescGZIP() []byte {
return file_request_proto_rawDescData return file_request_proto_rawDescData
} }
var file_request_proto_enumTypes = make([]protoimpl.EnumInfo, 12) var file_request_proto_enumTypes = make([]protoimpl.EnumInfo, 15)
var file_request_proto_msgTypes = make([]protoimpl.MessageInfo, 19) var file_request_proto_msgTypes = make([]protoimpl.MessageInfo, 23)
var file_request_proto_goTypes = []interface{}{ var file_request_proto_goTypes = []interface{}{
(DriverType)(0), // 0: request.DriverType (DriverType)(0), // 0: request.DriverType
(Relay_Operation)(0), // 1: request.Relay.Operation (Relay_Operation)(0), // 1: request.Relay.Operation
@ -1952,52 +2382,63 @@ var file_request_proto_goTypes = []interface{}{
(Psd_Force)(0), // 9: request.Psd.Force (Psd_Force)(0), // 9: request.Psd.Force
(Psd_Fault)(0), // 10: request.Psd.Fault (Psd_Fault)(0), // 10: request.Psd.Fault
(TrainControl_TrainControlType)(0), // 11: request.TrainControl.TrainControlType (TrainControl_TrainControlType)(0), // 11: request.TrainControl.TrainControlType
(*Relay)(nil), // 12: request.Relay (Ckm_Operation)(0), // 12: request.Ckm.Operation
(*RelayOperationReq)(nil), // 13: request.RelayOperationReq (Ckm_Force)(0), // 13: request.Ckm.Force
(*Points)(nil), // 14: request.Points (Ckm_Fault)(0), // 14: request.Ckm.Fault
(*PointsOperationReq)(nil), // 15: request.PointsOperationReq (*Relay)(nil), // 15: request.Relay
(*PointsParam)(nil), // 16: request.PointsParam (*RelayOperationReq)(nil), // 16: request.RelayOperationReq
(*Signal)(nil), // 17: request.Signal (*Points)(nil), // 17: request.Points
(*SignalOperationReq)(nil), // 18: request.SignalOperationReq (*PointsOperationReq)(nil), // 18: request.PointsOperationReq
(*SignalParam)(nil), // 19: request.SignalParam (*PointsParam)(nil), // 19: request.PointsParam
(*Section)(nil), // 20: request.Section (*Signal)(nil), // 20: request.Signal
(*SectionOperationReq)(nil), // 21: request.SectionOperationReq (*SignalOperationReq)(nil), // 21: request.SignalOperationReq
(*SectionParam)(nil), // 22: request.SectionParam (*SignalParam)(nil), // 22: request.SignalParam
(*Psd)(nil), // 23: request.Psd (*Section)(nil), // 23: request.Section
(*PsdOperationReq)(nil), // 24: request.PsdOperationReq (*SectionOperationReq)(nil), // 24: request.SectionOperationReq
(*PsdParam)(nil), // 25: request.PsdParam (*SectionParam)(nil), // 25: request.SectionParam
(*TrainControl)(nil), // 26: request.TrainControl (*Psd)(nil), // 26: request.Psd
(*TrainControl_EmergentButton)(nil), // 27: request.TrainControl.EmergentButton (*PsdOperationReq)(nil), // 27: request.PsdOperationReq
(*TrainControl_DriverKeySwitch)(nil), // 28: request.TrainControl.DriverKeySwitch (*PsdParam)(nil), // 28: request.PsdParam
(*TrainControl_DirectionKeySwitch)(nil), // 29: request.TrainControl.DirectionKeySwitch (*TrainControl)(nil), // 29: request.TrainControl
(*TrainControl_PushHandler)(nil), // 30: request.TrainControl.PushHandler (*CkmOperationReq)(nil), // 30: request.CkmOperationReq
(*Ckm)(nil), // 31: request.Ckm
(*CkmParam)(nil), // 32: request.CkmParam
(*CkmBoxOperationReq)(nil), // 33: request.CkmBoxOperationReq
(*TrainControl_EmergentButton)(nil), // 34: request.TrainControl.EmergentButton
(*TrainControl_DriverKeySwitch)(nil), // 35: request.TrainControl.DriverKeySwitch
(*TrainControl_DirectionKeySwitch)(nil), // 36: request.TrainControl.DirectionKeySwitch
(*TrainControl_PushHandler)(nil), // 37: request.TrainControl.PushHandler
} }
var file_request_proto_depIdxs = []int32{ var file_request_proto_depIdxs = []int32{
1, // 0: request.RelayOperationReq.operation:type_name -> request.Relay.Operation 1, // 0: request.RelayOperationReq.operation:type_name -> request.Relay.Operation
2, // 1: request.PointsOperationReq.operation:type_name -> request.Points.Operation 2, // 1: request.PointsOperationReq.operation:type_name -> request.Points.Operation
16, // 2: request.PointsOperationReq.param:type_name -> request.PointsParam 19, // 2: request.PointsOperationReq.param:type_name -> request.PointsParam
3, // 3: request.PointsParam.forcePosition:type_name -> request.Points.Force 3, // 3: request.PointsParam.forcePosition:type_name -> request.Points.Force
4, // 4: request.SignalOperationReq.operation:type_name -> request.Signal.Operation 4, // 4: request.SignalOperationReq.operation:type_name -> request.Signal.Operation
19, // 5: request.SignalOperationReq.param:type_name -> request.SignalParam 22, // 5: request.SignalOperationReq.param:type_name -> request.SignalParam
6, // 6: request.SignalParam.force:type_name -> request.Signal.Force 6, // 6: request.SignalParam.force:type_name -> request.Signal.Force
5, // 7: request.SignalParam.dsList:type_name -> request.Signal.DS 5, // 7: request.SignalParam.dsList:type_name -> request.Signal.DS
7, // 8: request.SectionOperationReq.operation:type_name -> request.Section.Operation 7, // 8: request.SectionOperationReq.operation:type_name -> request.Section.Operation
22, // 9: request.SectionOperationReq.param:type_name -> request.SectionParam 25, // 9: request.SectionOperationReq.param:type_name -> request.SectionParam
8, // 10: request.PsdOperationReq.operation:type_name -> request.Psd.Operation 8, // 10: request.PsdOperationReq.operation:type_name -> request.Psd.Operation
25, // 11: request.PsdOperationReq.param:type_name -> request.PsdParam 28, // 11: request.PsdOperationReq.param:type_name -> request.PsdParam
9, // 12: request.PsdParam.force:type_name -> request.Psd.Force 9, // 12: request.PsdParam.force:type_name -> request.Psd.Force
10, // 13: request.PsdParam.fault:type_name -> request.Psd.Fault 10, // 13: request.PsdParam.fault:type_name -> request.Psd.Fault
11, // 14: request.TrainControl.controlType:type_name -> request.TrainControl.TrainControlType 11, // 14: request.TrainControl.controlType:type_name -> request.TrainControl.TrainControlType
27, // 15: request.TrainControl.button:type_name -> request.TrainControl.EmergentButton 34, // 15: request.TrainControl.button:type_name -> request.TrainControl.EmergentButton
28, // 16: request.TrainControl.driverKey:type_name -> request.TrainControl.DriverKeySwitch 35, // 16: request.TrainControl.driverKey:type_name -> request.TrainControl.DriverKeySwitch
29, // 17: request.TrainControl.dirKey:type_name -> request.TrainControl.DirectionKeySwitch 36, // 17: request.TrainControl.dirKey:type_name -> request.TrainControl.DirectionKeySwitch
30, // 18: request.TrainControl.handler:type_name -> request.TrainControl.PushHandler 37, // 18: request.TrainControl.handler:type_name -> request.TrainControl.PushHandler
0, // 19: request.TrainControl.DriverKeySwitch.dt:type_name -> request.DriverType 12, // 19: request.CkmOperationReq.operation:type_name -> request.Ckm.Operation
20, // [20:20] is the sub-list for method output_type 32, // 20: request.CkmOperationReq.param:type_name -> request.CkmParam
20, // [20:20] is the sub-list for method input_type 13, // 21: request.CkmParam.force:type_name -> request.Ckm.Force
20, // [20:20] is the sub-list for extension type_name 14, // 22: request.CkmParam.fault:type_name -> request.Ckm.Fault
20, // [20:20] is the sub-list for extension extendee 0, // 23: request.TrainControl.DriverKeySwitch.dt:type_name -> request.DriverType
0, // [0:20] is the sub-list for field type_name 24, // [24:24] is the sub-list for method output_type
24, // [24:24] is the sub-list for method input_type
24, // [24:24] is the sub-list for extension type_name
24, // [24:24] is the sub-list for extension extendee
0, // [0:24] is the sub-list for field type_name
} }
func init() { file_request_proto_init() } func init() { file_request_proto_init() }
@ -2187,7 +2628,7 @@ func file_request_proto_init() {
} }
} }
file_request_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { file_request_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*TrainControl_EmergentButton); i { switch v := v.(*CkmOperationReq); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:
@ -2199,7 +2640,7 @@ func file_request_proto_init() {
} }
} }
file_request_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { file_request_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*TrainControl_DriverKeySwitch); i { switch v := v.(*Ckm); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:
@ -2211,7 +2652,7 @@ func file_request_proto_init() {
} }
} }
file_request_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { file_request_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*TrainControl_DirectionKeySwitch); i { switch v := v.(*CkmParam); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:
@ -2223,6 +2664,54 @@ func file_request_proto_init() {
} }
} }
file_request_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { file_request_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CkmBoxOperationReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_request_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*TrainControl_EmergentButton); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_request_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*TrainControl_DriverKeySwitch); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_request_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*TrainControl_DirectionKeySwitch); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_request_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*TrainControl_PushHandler); i { switch v := v.(*TrainControl_PushHandler); i {
case 0: case 0:
return &v.state return &v.state
@ -2240,8 +2729,8 @@ func file_request_proto_init() {
File: protoimpl.DescBuilder{ File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_request_proto_rawDesc, RawDescriptor: file_request_proto_rawDesc,
NumEnums: 12, NumEnums: 15,
NumMessages: 19, NumMessages: 23,
NumExtensions: 0, NumExtensions: 0,
NumServices: 0, NumServices: 0,
}, },

File diff suppressed because it is too large Load Diff

View File

@ -3,6 +3,7 @@ package message_server
import ( import (
"fmt" "fmt"
"joylink.club/bj-rtsts-server/dto/state_proto" "joylink.club/bj-rtsts-server/dto/state_proto"
"log/slog"
"time" "time"
"joylink.club/bj-rtsts-server/dto/data_proto" "joylink.club/bj-rtsts-server/dto/data_proto"
@ -16,19 +17,34 @@ import (
func NewPSLMs(vs *memory.VerifySimulation, mapId int32) ms_api.MsgTask { func NewPSLMs(vs *memory.VerifySimulation, mapId int32) ms_api.MsgTask {
mapData := memory.QueryGiData[*data_proto.RtssGraphicStorage](mapId) mapData := memory.QueryGiData[*data_proto.RtssGraphicStorage](mapId)
return ms_api.NewScheduleTask(fmt.Sprintf("地图[%d]综合门控箱按钮状态", mapId), func() error { return ms_api.NewScheduleTask(fmt.Sprintf("地图[%d]PSL按钮状态", mapId), func() error {
for _, box := range mapData.GateBoxs { for _, box := range mapData.GateBoxs {
did := memory.GetMapElementId(box.Common) did := memory.GetMapElementId(box.Common)
data_proto, err := collectGateBoxPSLState(vs.World, mapId, box) data, err := collectGateBoxPSLState(vs.World, mapId, box)
if err != nil { if err != nil {
return err return err
} }
mqtt.GetMsgClient().PubPSLState(vs.SimulationId, mapId, did, data_proto) sendMsg(vs, mapId, did, data)
}
for _, box := range mapData.GarageDoorBoxes {
did := memory.GetMapElementId(box.Common)
data, err := collectGarageDoorBoxPSLState(vs.World, mapId, box)
if err != nil {
return err
}
sendMsg(vs, mapId, did, data)
} }
return nil return nil
}, 200*time.Millisecond) }, 200*time.Millisecond)
} }
func sendMsg(vs *memory.VerifySimulation, mapId int32, pslId uint32, data *state_proto.PushedDevicesStatus) {
err := mqtt.GetMsgClient().PubPSLState(vs.SimulationId, mapId, pslId, data)
if err != nil {
slog.Error(fmt.Sprintf("发送PSL状态出错%s", err.Error()))
}
}
func collectGateBoxPSLState(world ecs.World, mapId int32, box *data_proto.GatedBox) (*state_proto.PushedDevicesStatus, error) { func collectGateBoxPSLState(world ecs.World, mapId int32, box *data_proto.GatedBox) (*state_proto.PushedDevicesStatus, error) {
did := memory.GetMapElementId(box.Common) did := memory.GetMapElementId(box.Common)
uidStructure := memory.QueryUidStructure[*memory.StationUidStructure](mapId) uidStructure := memory.QueryUidStructure[*memory.StationUidStructure](mapId)
@ -67,3 +83,43 @@ func collectGateBoxPSLState(world ecs.World, mapId int32, box *data_proto.GatedB
}, },
}, nil }, nil
} }
func collectGarageDoorBoxPSLState(world ecs.World, mapId int32, box *data_proto.GarageDoorBox) (*state_proto.PushedDevicesStatus, error) {
return nil, nil
//did := memory.GetMapElementId(box.Common)
//uidStructure := memory.QueryUidStructure[*memory.StationUidStructure](mapId)
//boxUid := uidStructure.PslIds[did].Uid
//mkxEntry, ok := entity.GetEntityByUid(world, boxUid)
//if !ok {
// return nil, fmt.Errorf("[id:%s]的门控箱实体找不到", boxUid)
//}
//mkx := component.MkxType.Get(mkxEntry)
//var buttonStateArr []*state_proto.ButtonState
//if ok {
// _, pslStorage := memory.QueryGiDataByName[*data_proto.PslGraphicStorage](box.RefGatedBoxMapCode)
// btnUidMap := make(map[string]uint32, len(pslStorage.PslButtons))
// for _, button := range pslStorage.PslButtons {
// btnUidMap[boxUid+"_"+button.Code] = memory.GetMapElementId(button.Common)
// }
// btnArr := []*ecs.Entry{mkx.PCB, mkx.PCBPL, mkx.POB, mkx.POBPL, mkx.PAB, mkx.PABPL, mkx.WRZF, mkx.WRZFPL,
// mkx.QKQR, mkx.QKQRPL, mkx.MPL, mkx.JXTCPL}
// for _, btn := range btnArr {
// if btn == nil {
// continue
// }
// btnState := component.BitStateType.Get(btn)
// buttonStateArr = append(buttonStateArr, &state_proto.ButtonState{
// Id: btnUidMap[component.UidType.Get(btn).Id],
// Down: btnState.Val,
// Active: btnState.Val,
// //Bypass: btnState.BypassEnable,
// })
// }
//}
//return &state_proto.PushedDevicesStatus{
// All: true,
// AllStatus: &state_proto.AllDevicesStatus{
// ButtonState: buttonStateArr,
// },
//}, nil
}

View File

@ -59,6 +59,10 @@ func NewSfpMs(vs *memory.VerifySimulation, mapId int32) ms_api.MsgTask {
if err != nil { if err != nil {
return err return err
} }
ckmStates, err := collectCkmStates(vs.World, mapId)
if err != nil {
return err
}
ststes := &state_proto.PushedDevicesStatus{ ststes := &state_proto.PushedDevicesStatus{
All: true, All: true,
AllStatus: &state_proto.AllDevicesStatus{ AllStatus: &state_proto.AllDevicesStatus{
@ -70,6 +74,7 @@ func NewSfpMs(vs *memory.VerifySimulation, mapId int32) ms_api.MsgTask {
SectionState: sectionStates, SectionState: sectionStates,
PlatformState: platformStates, PlatformState: platformStates,
BaliseState: baliseStates, BaliseState: baliseStates,
CkmStates: ckmStates,
}, },
} }
err = mqtt.GetMsgClient().PubSfpState(vs.SimulationId, mapId, ststes) err = mqtt.GetMsgClient().PubSfpState(vs.SimulationId, mapId, ststes)
@ -80,6 +85,32 @@ func NewSfpMs(vs *memory.VerifySimulation, mapId int32) ms_api.MsgTask {
}, 1000*time.Millisecond) }, 1000*time.Millisecond)
} }
func collectCkmStates(world ecs.World, mapId int32) ([]*state_proto.CkmState, error) {
uidStructure := memory.QueryUidStructure[*memory.StationUidStructure](mapId)
var ckmStates []*state_proto.CkmState
for id, structure := range uidStructure.CkmIds {
entry, ok := entity.GetEntityByUid(world, structure.Uid)
if ok {
circuit := component.CkmCircuitType.Get(entry)
mgj := component.BitStateType.Get(circuit.MGJ).Val
var ckmParam *request_proto.CkmParam
if entry.HasComponent(appcomponent.CkmParamType) {
ckmParam = appcomponent.CkmParamType.Get(entry)
} else {
ckmParam = &request_proto.CkmParam{}
}
stateLoss := entry.HasComponent(component.CkmStateLossTag)
ckmStates = append(ckmStates, &state_proto.CkmState{
Id: id,
Mgj: mgj,
Param: ckmParam,
StateLoss: stateLoss,
})
}
}
return ckmStates, nil
}
// 收集应答器状态 // 收集应答器状态
func collectBaliseStates(world ecs.World, mapId int32) ([]*state_proto.BaliseState, error) { func collectBaliseStates(world ecs.World, mapId int32) ([]*state_proto.BaliseState, error) {
uidStructure := memory.QueryUidStructure[*memory.StationUidStructure](mapId) uidStructure := memory.QueryUidStructure[*memory.StationUidStructure](mapId)

View File

@ -15,7 +15,7 @@ var (
basePath, _ = os.Getwd() basePath, _ = os.Getwd()
protoFolder = filepath.Join(basePath, "rts-sim-testing-message", "protos") protoFolder = filepath.Join(basePath, "rts-sim-testing-message", "protos")
protocPath = filepath.Join(basePath, "rts-sim-testing-message", "protoc-23.1", "bin", "win64", "protoc") protocPath = filepath.Join(basePath, "rts-sim-testing-message", "protoc-23.1", "bin", "win64", "protoc")
modulePrefix = "joylink.club/rts-sim-testing-service" modulePrefix = "joylink.club/bj-rtsts-server"
) )
func main() { func main() {

@ -1 +1 @@
Subproject commit f0a6c534ec7b4b0bb128a435c17ef2b20e481b94 Subproject commit 33ed496dcd8697ad9d86077a0587140de49deee7

@ -1 +1 @@
Subproject commit cd5946438c5100f5685877ea5ce632fd5b5962a7 Subproject commit f9034ba53d9b201140e9e43dbe8f5b8faa21633a

View File

@ -10,4 +10,5 @@ var (
SignalParamType = ecs.NewComponentType[request_proto.SignalParam]() SignalParamType = ecs.NewComponentType[request_proto.SignalParam]()
SectionParamType = ecs.NewComponentType[request_proto.SectionParam]() SectionParamType = ecs.NewComponentType[request_proto.SectionParam]()
PsdParamType = ecs.NewComponentType[request_proto.PsdParam]() PsdParamType = ecs.NewComponentType[request_proto.PsdParam]()
CkmParamType = ecs.NewComponentType[request_proto.CkmParam]()
) )

View File

@ -0,0 +1,41 @@
package memory
import (
"fmt"
"joylink.club/bj-rtsts-server/dto/data_proto"
"joylink.club/bj-rtsts-server/dto/request_proto"
"joylink.club/bj-rtsts-server/sys_error"
appcomponent "joylink.club/bj-rtsts-server/ts/simulation/app_component"
"joylink.club/ecs"
"joylink.club/rtsssimulation/entity"
"unsafe"
)
func CkmOperation(simulation *VerifySimulation, req *request_proto.CkmOperationReq) *sys_error.BusinessError {
switch req.Operation {
case request_proto.Ckm_SetParams:
return setParam(simulation, req)
default:
panic(fmt.Sprintf("未知的屏蔽门操作:%s", req.Operation))
}
return nil
}
func setParam(simulation *VerifySimulation, req *request_proto.CkmOperationReq) *sys_error.BusinessError {
uid := QueryUidByMidAndComId(req.MapId, req.DeviceId, &data_proto.GarageDoor{})
result := <-ecs.Request[ecs.EmptyType](simulation.World, func() ecs.Result[ecs.EmptyType] {
wd := entity.GetWorldData(simulation.World)
entry, ok := wd.EntityMap[uid]
if ok {
entry.AddComponent(appcomponent.CkmParamType, unsafe.Pointer(req.Param))
} else {
return ecs.NewErrResult(fmt.Errorf("未找到id=%s的实体", uid))
}
return ecs.NewOkEmptyResult()
})
if result.Err != nil {
return sys_error.New("车库门设置参数失败", result.Err)
} else {
return nil
}
}

View File

@ -79,7 +79,12 @@ func GenerateElementUid(city, lineId string, stationIndexList []string, code str
idArr = append(idArr, city, lineId) idArr = append(idArr, city, lineId)
idArr = append(idArr, stationIndexList...) idArr = append(idArr, stationIndexList...)
idArr = append(idArr, code) idArr = append(idArr, code)
return strings.Join(idArr, "_") return BuildUid(idArr...)
}
// GenerateElementUid 构建uid。将args用'_'连接
func BuildUid(args ...string) string {
return strings.Join(args, "_")
} }
// 移除内存中的地图信息 // 移除内存中的地图信息

View File

@ -44,6 +44,7 @@ type StationUidStructure struct {
PslIds map[uint32]*elementIdStructure PslIds map[uint32]*elementIdStructure
SpksSwitchIds map[uint32]*elementIdStructure SpksSwitchIds map[uint32]*elementIdStructure
IbpIds map[uint32]*elementIdStructure IbpIds map[uint32]*elementIdStructure
CkmIds map[uint32]*elementIdStructure
} }
type RelayUidStructure struct { type RelayUidStructure struct {
@ -256,6 +257,7 @@ func initStationUid(data *data_proto.RtssGraphicStorage) *StationUidStructure {
PslIds: make(map[uint32]*elementIdStructure, len(data.GateBoxs)), PslIds: make(map[uint32]*elementIdStructure, len(data.GateBoxs)),
//SpksSwitchIds: make(map[uint32]*elementIdStructure, len(data.SpksSwitchs)), //SpksSwitchIds: make(map[uint32]*elementIdStructure, len(data.SpksSwitchs)),
IbpIds: make(map[uint32]*elementIdStructure, len(data.IbpBoxs)), IbpIds: make(map[uint32]*elementIdStructure, len(data.IbpBoxs)),
CkmIds: make(map[uint32]*elementIdStructure, len(data.GarageDoors)),
} }
city, lineId, _ := getUIdPrefix(data.UniqueIdPrefix) city, lineId, _ := getUIdPrefix(data.UniqueIdPrefix)
// 处理车站信息 // 处理车站信息
@ -409,6 +411,24 @@ func initStationUid(data *data_proto.RtssGraphicStorage) *StationUidStructure {
Uid: GenerateElementUid(city, lineId, []string{stationName}, box.Code), Uid: GenerateElementUid(city, lineId, []string{stationName}, box.Code),
} }
} }
// CKM
for _, ckm := range data.GarageDoors {
eid := GetMapElementId(ckm.Common)
gus.CkmIds[eid] = &elementIdStructure{
CommonId: eid,
Code: ckm.Code,
Uid: GenerateElementUid(city, lineId, nil, ckm.Code),
}
}
for _, box := range data.GarageDoorBoxes {
eid := GetMapElementId(box.Common)
ckmUid := gus.CkmIds[box.RefGarageDoorId].Uid
gus.PslIds[eid] = &elementIdStructure{
CommonId: eid,
Code: box.Code,
Uid: BuildUid(ckmUid, strconv.Itoa(int(eid))),
}
}
//// SPKS人员防护 //// SPKS人员防护
//for _, spk := range data.SpksSwitchs { //for _, spk := range data.SpksSwitchs {
// if spk.RefStand == 0 { // if spk.RefStand == 0 {
@ -650,6 +670,10 @@ func getUidMapByType(uidData any, m interface{}) map[uint32]*elementIdStructure
return (uidData.(*StationUidStructure)).PslIds return (uidData.(*StationUidStructure)).PslIds
case *data_proto.IbpBox: case *data_proto.IbpBox:
return (uidData.(*StationUidStructure)).IbpIds return (uidData.(*StationUidStructure)).IbpIds
case *data_proto.GarageDoorBox:
return (uidData.(*StationUidStructure)).PslIds
case *data_proto.GarageDoor:
return (uidData.(*StationUidStructure)).CkmIds
default: default:
panic(&dto.ErrorDto{Code: dto.ArgumentParseError, Message: "类型未映射字段"}) panic(&dto.ErrorDto{Code: dto.ArgumentParseError, Message: "类型未映射字段"})
} }

View File

@ -1,16 +1,23 @@
package memory package memory
import ( import (
"joylink.club/bj-rtsts-server/sys_error"
"joylink.club/rtsssimulation/fi" "joylink.club/rtsssimulation/fi"
) )
// 操作PSL按钮 // 操作PSL按钮
func ChangePSLButtonState(sim *VerifySimulation, mapId int32, gateBoxId uint32, btnCode string, pressDown bool) { func ChangePSLButtonState(sim *VerifySimulation, mapId int32, gateBoxId uint32, btnCode string, pressDown bool) *sys_error.BusinessError {
uid := QueryUidStructure[*StationUidStructure](mapId) uid := QueryUidStructure[*StationUidStructure](mapId)
gateBoxUid := uid.PslIds[gateBoxId].Uid gateBoxUid := uid.PslIds[gateBoxId].Uid
var err error
if pressDown { if pressDown {
fi.PressDownButton(sim.World, gateBoxUid+"_"+btnCode) err = fi.PressDownButton(sim.World, gateBoxUid+"_"+btnCode)
} else { } else {
fi.PressUpButton(sim.World, gateBoxUid+"_"+btnCode) err = fi.PressUpButton(sim.World, gateBoxUid+"_"+btnCode)
}
if err != nil {
return sys_error.New("操作PSL按钮出错", err)
} else {
return nil
} }
} }

View File

@ -704,6 +704,10 @@ func buildAndRelateElectronicComponent(repo *proto.Repository, relayGi *data_pro
for _, platform := range repo.Platforms { for _, platform := range repo.Platforms {
platformMap[platform.Id] = platform platformMap[platform.Id] = platform
} }
ckmMap := make(map[string]*proto.Ckm)
for _, ckm := range repo.Ckms {
ckmMap[ckm.Id] = ckm
}
ciecs := stationMap[stationUid] //联锁集中站 ciecs := stationMap[stationUid] //联锁集中站
if ciecs == nil { if ciecs == nil {
panic(fmt.Errorf("联锁集中站[%s]不存在", stationUid)) panic(fmt.Errorf("联锁集中站[%s]不存在", stationUid))
@ -813,6 +817,27 @@ func buildAndRelateElectronicComponent(repo *proto.Repository, relayGi *data_pro
Egs: egs, Egs: egs,
}) })
} }
case data_proto.RelatedRef_GarageDoor: //车库门
{
ckm, ok := ckmMap[GenerateElementUid(city, lineId, nil, relationship.Code)]
if !ok {
continue
}
for _, group := range relationship.Combinationtypes {
var componentIds []string
for _, relayId := range group.RefRelays {
if relayUidStructure.RelayIds[relayId] == nil {
continue
}
componentIds = append(componentIds, relayUidStructure.RelayIds[relayId].Uid)
}
ckm.ElectronicComponentGroups = append(ckm.ElectronicComponentGroups,
&proto.ElectronicComponentGroup{
Code: group.Code,
ComponentIds: componentIds,
})
}
}
} }
} }
//门控箱 //门控箱
@ -848,24 +873,6 @@ func buildAndRelateElectronicComponent(repo *proto.Repository, relayGi *data_pro
} }
} }
} }
//cis := stationMap[stationUid]
//// 零散组合
//for _, com := range relayGi.CombinationtypeList {
// if com.Code == "LS" { // 零散组合
// d := &proto.ElectronicGroup{Code: com.Code}
// for _, relayId := range com.RefRelays {
// if relayUidStructure.RelayIds[relayId] == nil {
// continue
// }
// d.Components = append(d.Components, &proto.ElectronicComponent{
// BaliseId: relayUidStructure.RelayIds[relayId].Uid,
// DeviceType: proto.DeviceType_DeviceType_Relay,
// })
// }
// cis.ElectronicGroup = append(cis.ElectronicGroup, d)
// fmt.Println("构建零散组合结果:", d)
// }
//}
// 处理该集中站采集、驱动配置信息 // 处理该集中站采集、驱动配置信息
centralizedStationId := GenerateElementUid(city, lineId, nil, station) centralizedStationId := GenerateElementUid(city, lineId, nil, station)
ref := queryCentralizedStationRef(centralizedStationId, repo) ref := queryCentralizedStationRef(centralizedStationId, repo)
@ -1268,7 +1275,7 @@ func fillProtoRepository(repo *proto.Repository, storage *data_proto.RtssGraphic
platformId_psdUid_map[data.GetRefPlatformId()] = psd.Id platformId_psdUid_map[data.GetRefPlatformId()] = psd.Id
repo.Psds = append(repo.Psds, psd) repo.Psds = append(repo.Psds, psd)
} }
//PSL //屏蔽门PSL
for _, data := range storage.PslBoxs { for _, data := range storage.PslBoxs {
boxUidInfo := uidsMap.PslIds[GetMapElementId(data.Common)] boxUidInfo := uidsMap.PslIds[GetMapElementId(data.Common)]
mkx := &proto.Mkx{ mkx := &proto.Mkx{
@ -1319,6 +1326,43 @@ func fillProtoRepository(repo *proto.Repository, storage *data_proto.RtssGraphic
station := repoStationMap[data.RefStationId] station := repoStationMap[data.RefStationId]
handlerIBPDeviceToStation(station, boxUidInfo.Uid, repo, data.RefIbpMapCode) handlerIBPDeviceToStation(station, boxUidInfo.Uid, repo, data.RefIbpMapCode)
} }
//车库门
for _, data := range storage.GarageDoors {
id := GetMapElementId(data.Common)
ckm := &proto.Ckm{
Id: uidsMap.CkmIds[id].Uid,
}
repo.Ckms = append(repo.Ckms, ckm)
}
//车库门PSL
for _, data := range storage.GarageDoorBoxes {
boxUidInfo := uidsMap.PslIds[GetMapElementId(data.Common)]
ckmPsl := &proto.CkmPsl{
Id: boxUidInfo.Uid,
CkmId: uidsMap.CkmIds[data.RefGarageDoorId].Uid,
}
repo.CkmPsls = append(repo.CkmPsls, ckmPsl)
_, pslStorage := QueryGiDataByName[*data_proto.PslGraphicStorage](data.RefPslMapCode)
for _, button := range pslStorage.PslButtons {
repoButton := &proto.Button{
Id: boxUidInfo.Uid + "_" + button.Code,
Code: button.Code,
ButtonType: proto.Button_Reset_Press,
HasLight: true,
}
repo.Buttons = append(repo.Buttons, repoButton)
switch button.Code {
case "KMA":
ckmPsl.KmaId = repoButton.Id
case "GMA":
ckmPsl.GmaId = repoButton.Id
case "MPLA":
ckmPsl.MplaId = repoButton.Id
case "MMSA":
ckmPsl.MmsaId = repoButton.Id
}
}
}
} }
// 将IBP的设备关联到车站中 // 将IBP的设备关联到车站中