【新增】车库门及车库门控制盒操作接口

This commit is contained in:
thesai 2024-03-20 14:35:35 +08:00
parent 5856236b12
commit da98777b04
15 changed files with 2489 additions and 1848 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.32.0
// protoc-gen-go v1.33.0
// protoc v4.23.1
// 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.
// versions:
// protoc-gen-go v1.32.0
// protoc-gen-go v1.33.0
// protoc v4.23.1
// source: tccGraphics.proto
@ -20,50 +20,50 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type TccKeyType int32
type TccKey_TccKeyType int32
const (
TccKeyType_driverControllerActivationClint TccKeyType = 0 //司控器激活端
TccKeyType_frontAndRearDirectionalControl TccKeyType = 1 //前后方向控制
TccKey_driverControllerActivationClint TccKey_TccKeyType = 0 //司控器激活端
TccKey_frontAndRearDirectionalControl TccKey_TccKeyType = 1 //前后方向控制
)
// Enum value maps for TccKeyType.
// Enum value maps for TccKey_TccKeyType.
var (
TccKeyType_name = map[int32]string{
TccKey_TccKeyType_name = map[int32]string{
0: "driverControllerActivationClint",
1: "frontAndRearDirectionalControl",
}
TccKeyType_value = map[string]int32{
TccKey_TccKeyType_value = map[string]int32{
"driverControllerActivationClint": 0,
"frontAndRearDirectionalControl": 1,
}
)
func (x TccKeyType) Enum() *TccKeyType {
p := new(TccKeyType)
func (x TccKey_TccKeyType) Enum() *TccKey_TccKeyType {
p := new(TccKey_TccKeyType)
*p = x
return p
}
func (x TccKeyType) String() string {
func (x TccKey_TccKeyType) String() string {
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()
}
func (TccKeyType) Type() protoreflect.EnumType {
func (TccKey_TccKeyType) Type() protoreflect.EnumType {
return &file_tccGraphics_proto_enumTypes[0]
}
func (x TccKeyType) Number() protoreflect.EnumNumber {
func (x TccKey_TccKeyType) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use TccKeyType.Descriptor instead.
func (TccKeyType) EnumDescriptor() ([]byte, []int) {
return file_tccGraphics_proto_rawDescGZIP(), []int{0}
// Deprecated: Use TccKey_TccKeyType.Descriptor instead.
func (TccKey_TccKeyType) EnumDescriptor() ([]byte, []int) {
return file_tccGraphics_proto_rawDescGZIP(), []int{3, 0}
}
type TccGraphicStorage struct {
@ -297,7 +297,7 @@ type TccKey struct {
Common *CommonInfo `protobuf:"bytes,1,opt,name=common,proto3" json:"common,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() {
@ -346,11 +346,11 @@ func (x *TccKey) GetCode() string {
return ""
}
func (x *TccKey) GetType() TccKeyType {
func (x *TccKey) GetType() TccKey_TccKeyType {
if x != nil {
return x.Type
}
return TccKeyType_driverControllerActivationClint
return TccKey_driverControllerActivationClint
}
// * 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,
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, 0x22, 0x7d, 0x0a, 0x06, 0x54, 0x63, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x2f, 0x0a, 0x06, 0x63,
0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x72,
0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e,
0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04,
0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65,
0x12, 0x2e, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a,
0x2e, 0x74, 0x63, 0x63, 0x47, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e,
0x54, 0x63, 0x63, 0x4b, 0x65, 0x79, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65,
0x22, 0x50, 0x0a, 0x09, 0x54, 0x63, 0x63, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x2f, 0x0a,
0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e,
0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6d, 0x6d,
0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x12,
0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f,
0x64, 0x65, 0x2a, 0x55, 0x0a, 0x0a, 0x54, 0x63, 0x63, 0x4b, 0x65, 0x79, 0x54, 0x79, 0x70, 0x65,
0x12, 0x23, 0x0a, 0x1f, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f,
0x6c, 0x6c, 0x65, 0x72, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6c,
0x69, 0x6e, 0x74, 0x10, 0x00, 0x12, 0x22, 0x0a, 0x1e, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x41, 0x6e,
0x64, 0x52, 0x65, 0x61, 0x72, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c,
0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x10, 0x01, 0x42, 0x2d, 0x5a, 0x2b, 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, 0x64, 0x61,
0x74, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x65, 0x22, 0xdb, 0x01, 0x0a, 0x06, 0x54, 0x63, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x2f, 0x0a, 0x06,
0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67,
0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f,
0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x12, 0x0a,
0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64,
0x65, 0x12, 0x35, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32,
0x21, 0x2e, 0x74, 0x63, 0x63, 0x47, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61,
0x2e, 0x54, 0x63, 0x63, 0x4b, 0x65, 0x79, 0x2e, 0x54, 0x63, 0x63, 0x4b, 0x65, 0x79, 0x54, 0x79,
0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x55, 0x0a, 0x0a, 0x54, 0x63, 0x63, 0x4b,
0x65, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x23, 0x0a, 0x1f, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72,
0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6c, 0x69, 0x6e, 0x74, 0x10, 0x00, 0x12, 0x22, 0x0a, 0x1e, 0x66,
0x72, 0x6f, 0x6e, 0x74, 0x41, 0x6e, 0x64, 0x52, 0x65, 0x61, 0x72, 0x44, 0x69, 0x72, 0x65, 0x63,
0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x10, 0x01, 0x22,
0x50, 0x0a, 0x09, 0x54, 0x63, 0x63, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x2f, 0x0a, 0x06,
0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67,
0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f,
0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x12, 0x0a,
0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64,
0x65, 0x42, 0x2d, 0x5a, 0x2b, 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, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -490,7 +491,7 @@ func file_tccGraphics_proto_rawDescGZIP() []byte {
var file_tccGraphics_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_tccGraphics_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_tccGraphics_proto_goTypes = []interface{}{
(TccKeyType)(0), // 0: tccGraphicData.TccKeyType
(TccKey_TccKeyType)(0), // 0: tccGraphicData.TccKey.TccKeyType
(*TccGraphicStorage)(nil), // 1: tccGraphicData.TccGraphicStorage
(*TccButton)(nil), // 2: tccGraphicData.TccButton
(*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, // 6: tccGraphicData.TccText.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
10, // [10:10] is the sub-list for method output_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.
// versions:
// protoc-gen-go v1.32.0
// protoc-gen-go v1.33.0
// protoc v4.23.1
// source: request.proto
@ -633,6 +633,147 @@ func (TrainControl_TrainControlType) EnumDescriptor() ([]byte, []int) {
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 {
state protoimpl.MessageState
@ -1544,6 +1685,258 @@ func (x *TrainControl) GetHandler() *TrainControl_PushHandler {
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 {
state protoimpl.MessageState
@ -1556,7 +1949,7 @@ type TrainControl_EmergentButton struct {
func (x *TrainControl_EmergentButton) Reset() {
*x = TrainControl_EmergentButton{}
if protoimpl.UnsafeEnabled {
mi := &file_request_proto_msgTypes[15]
mi := &file_request_proto_msgTypes[19]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -1569,7 +1962,7 @@ func (x *TrainControl_EmergentButton) String() string {
func (*TrainControl_EmergentButton) ProtoMessage() {}
func (x *TrainControl_EmergentButton) ProtoReflect() protoreflect.Message {
mi := &file_request_proto_msgTypes[15]
mi := &file_request_proto_msgTypes[19]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -1605,7 +1998,7 @@ type TrainControl_DriverKeySwitch struct {
func (x *TrainControl_DriverKeySwitch) Reset() {
*x = TrainControl_DriverKeySwitch{}
if protoimpl.UnsafeEnabled {
mi := &file_request_proto_msgTypes[16]
mi := &file_request_proto_msgTypes[20]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -1618,7 +2011,7 @@ func (x *TrainControl_DriverKeySwitch) String() string {
func (*TrainControl_DriverKeySwitch) ProtoMessage() {}
func (x *TrainControl_DriverKeySwitch) ProtoReflect() protoreflect.Message {
mi := &file_request_proto_msgTypes[16]
mi := &file_request_proto_msgTypes[20]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -1659,7 +2052,7 @@ type TrainControl_DirectionKeySwitch struct {
func (x *TrainControl_DirectionKeySwitch) Reset() {
*x = TrainControl_DirectionKeySwitch{}
if protoimpl.UnsafeEnabled {
mi := &file_request_proto_msgTypes[17]
mi := &file_request_proto_msgTypes[21]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -1672,7 +2065,7 @@ func (x *TrainControl_DirectionKeySwitch) String() string {
func (*TrainControl_DirectionKeySwitch) ProtoMessage() {}
func (x *TrainControl_DirectionKeySwitch) ProtoReflect() protoreflect.Message {
mi := &file_request_proto_msgTypes[17]
mi := &file_request_proto_msgTypes[21]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -1707,7 +2100,7 @@ type TrainControl_PushHandler struct {
func (x *TrainControl_PushHandler) Reset() {
*x = TrainControl_PushHandler{}
if protoimpl.UnsafeEnabled {
mi := &file_request_proto_msgTypes[18]
mi := &file_request_proto_msgTypes[22]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -1720,7 +2113,7 @@ func (x *TrainControl_PushHandler) String() string {
func (*TrainControl_PushHandler) ProtoMessage() {}
func (x *TrainControl_PushHandler) ProtoReflect() protoreflect.Message {
mi := &file_request_proto_msgTypes[18]
mi := &file_request_proto_msgTypes[22]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
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,
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,
0x0b, 0x0a, 0x07, 0x48, 0x41, 0x4e, 0x44, 0x4c, 0x45, 0x52, 0x10, 0x03, 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,
0x0b, 0x0a, 0x07, 0x48, 0x41, 0x4e, 0x44, 0x4c, 0x45, 0x52, 0x10, 0x03, 0x22, 0xc6, 0x01, 0x0a,
0x0f, 0x43, 0x6b, 0x6d, 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, 0x64, 0x65,
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 (
@ -1937,8 +2367,8 @@ func file_request_proto_rawDescGZIP() []byte {
return file_request_proto_rawDescData
}
var file_request_proto_enumTypes = make([]protoimpl.EnumInfo, 12)
var file_request_proto_msgTypes = make([]protoimpl.MessageInfo, 19)
var file_request_proto_enumTypes = make([]protoimpl.EnumInfo, 15)
var file_request_proto_msgTypes = make([]protoimpl.MessageInfo, 23)
var file_request_proto_goTypes = []interface{}{
(DriverType)(0), // 0: request.DriverType
(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_Fault)(0), // 10: request.Psd.Fault
(TrainControl_TrainControlType)(0), // 11: request.TrainControl.TrainControlType
(*Relay)(nil), // 12: request.Relay
(*RelayOperationReq)(nil), // 13: request.RelayOperationReq
(*Points)(nil), // 14: request.Points
(*PointsOperationReq)(nil), // 15: request.PointsOperationReq
(*PointsParam)(nil), // 16: request.PointsParam
(*Signal)(nil), // 17: request.Signal
(*SignalOperationReq)(nil), // 18: request.SignalOperationReq
(*SignalParam)(nil), // 19: request.SignalParam
(*Section)(nil), // 20: request.Section
(*SectionOperationReq)(nil), // 21: request.SectionOperationReq
(*SectionParam)(nil), // 22: request.SectionParam
(*Psd)(nil), // 23: request.Psd
(*PsdOperationReq)(nil), // 24: request.PsdOperationReq
(*PsdParam)(nil), // 25: request.PsdParam
(*TrainControl)(nil), // 26: request.TrainControl
(*TrainControl_EmergentButton)(nil), // 27: request.TrainControl.EmergentButton
(*TrainControl_DriverKeySwitch)(nil), // 28: request.TrainControl.DriverKeySwitch
(*TrainControl_DirectionKeySwitch)(nil), // 29: request.TrainControl.DirectionKeySwitch
(*TrainControl_PushHandler)(nil), // 30: request.TrainControl.PushHandler
(Ckm_Operation)(0), // 12: request.Ckm.Operation
(Ckm_Force)(0), // 13: request.Ckm.Force
(Ckm_Fault)(0), // 14: request.Ckm.Fault
(*Relay)(nil), // 15: request.Relay
(*RelayOperationReq)(nil), // 16: request.RelayOperationReq
(*Points)(nil), // 17: request.Points
(*PointsOperationReq)(nil), // 18: request.PointsOperationReq
(*PointsParam)(nil), // 19: request.PointsParam
(*Signal)(nil), // 20: request.Signal
(*SignalOperationReq)(nil), // 21: request.SignalOperationReq
(*SignalParam)(nil), // 22: request.SignalParam
(*Section)(nil), // 23: request.Section
(*SectionOperationReq)(nil), // 24: request.SectionOperationReq
(*SectionParam)(nil), // 25: request.SectionParam
(*Psd)(nil), // 26: request.Psd
(*PsdOperationReq)(nil), // 27: request.PsdOperationReq
(*PsdParam)(nil), // 28: request.PsdParam
(*TrainControl)(nil), // 29: request.TrainControl
(*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{
1, // 0: request.RelayOperationReq.operation:type_name -> request.Relay.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
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
5, // 7: request.SignalParam.dsList:type_name -> request.Signal.DS
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
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
10, // 13: request.PsdParam.fault:type_name -> request.Psd.Fault
11, // 14: request.TrainControl.controlType:type_name -> request.TrainControl.TrainControlType
27, // 15: request.TrainControl.button:type_name -> request.TrainControl.EmergentButton
28, // 16: request.TrainControl.driverKey:type_name -> request.TrainControl.DriverKeySwitch
29, // 17: request.TrainControl.dirKey:type_name -> request.TrainControl.DirectionKeySwitch
30, // 18: request.TrainControl.handler:type_name -> request.TrainControl.PushHandler
0, // 19: request.TrainControl.DriverKeySwitch.dt:type_name -> request.DriverType
20, // [20:20] is the sub-list for method output_type
20, // [20:20] is the sub-list for method input_type
20, // [20:20] is the sub-list for extension type_name
20, // [20:20] is the sub-list for extension extendee
0, // [0:20] is the sub-list for field type_name
34, // 15: request.TrainControl.button:type_name -> request.TrainControl.EmergentButton
35, // 16: request.TrainControl.driverKey:type_name -> request.TrainControl.DriverKeySwitch
36, // 17: request.TrainControl.dirKey:type_name -> request.TrainControl.DirectionKeySwitch
37, // 18: request.TrainControl.handler:type_name -> request.TrainControl.PushHandler
12, // 19: request.CkmOperationReq.operation:type_name -> request.Ckm.Operation
32, // 20: request.CkmOperationReq.param:type_name -> request.CkmParam
13, // 21: request.CkmParam.force:type_name -> request.Ckm.Force
14, // 22: request.CkmParam.fault:type_name -> request.Ckm.Fault
0, // 23: request.TrainControl.DriverKeySwitch.dt:type_name -> request.DriverType
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() }
@ -2187,7 +2628,7 @@ func file_request_proto_init() {
}
}
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:
return &v.state
case 1:
@ -2199,7 +2640,7 @@ func file_request_proto_init() {
}
}
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:
return &v.state
case 1:
@ -2211,7 +2652,7 @@ func file_request_proto_init() {
}
}
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:
return &v.state
case 1:
@ -2223,6 +2664,54 @@ func file_request_proto_init() {
}
}
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 {
case 0:
return &v.state
@ -2240,8 +2729,8 @@ func file_request_proto_init() {
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_request_proto_rawDesc,
NumEnums: 12,
NumMessages: 19,
NumEnums: 15,
NumMessages: 23,
NumExtensions: 0,
NumServices: 0,
},

File diff suppressed because it is too large Load Diff

View File

@ -1,86 +0,0 @@
package main
import (
"bufio"
"fmt"
"io/fs"
"log"
"os"
"os/exec"
"path/filepath"
"strings"
)
var (
basePath, _ = os.Getwd()
protoFolder = filepath.Join(basePath, "rts-sim-testing-message", "protos")
protocPath = filepath.Join(basePath, "rts-sim-testing-message", "protoc-23.1", "bin", "win64", "protoc")
modulePrefix = "joylink.club/rts-sim-testing-service"
)
func main() {
//先安装以下插件
//go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
protoFiles := getProtoFiles()
// 编译proto文件为Go文件
if err := compileProto(protoFiles); err != nil {
log.Fatalf("编译proto文件失败%v", err)
}
}
// 获取指定文件夹下的所有proto文件的绝对路径
func getProtoFiles() []string {
var protoFiles []string
err := filepath.WalkDir(protoFolder, func(path string, d fs.DirEntry, err error) error {
if !d.IsDir() {
protoFiles = append(protoFiles, path)
}
return err
})
if err != nil {
log.Fatal("获取proto文件列表失败:", err)
}
return protoFiles
}
// 编译proto文件为Go文件
func compileProto(protoFiles []string) error {
for _, fileName := range protoFiles {
file, err := os.Open(fileName)
if err != nil {
return err
}
scanner := bufio.NewScanner(file)
var outPath string
for scanner.Scan() {
text := scanner.Text()
if !strings.HasPrefix(text, "option go_package") {
continue
}
start := strings.Index(text, modulePrefix)
if start < 0 {
break
}
start += len(modulePrefix)
dir := "." + text[start:len(text)-2]
err := os.MkdirAll(dir, fs.ModeDir)
if err != nil {
panic(fmt.Sprintf("创建目录 %s 失败:%v", dir, err))
}
outPath = "paths=source_relative:" + dir
break
}
if outPath == "" {
outPath = "./"
}
cmd := exec.Command(protocPath, "-I="+protoFolder, "--go_out="+outPath, fileName)
fmt.Println(cmd.String())
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if err := cmd.Run(); err != nil {
return err
}
}
return nil
}

@ -1 +1 @@
Subproject commit cd5946438c5100f5685877ea5ce632fd5b5962a7
Subproject commit b748c7ff3ed7d401c8caeaecd3d4ec719ae27ee2

View File

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

View File

@ -0,0 +1,58 @@
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"
"joylink.club/rtsssimulation/fi"
"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 CkmBoxOperation(sim *VerifySimulation, req *request_proto.CkmBoxOperationReq) *sys_error.BusinessError {
uid := QueryUidStructure[*StationUidStructure](req.MapId)
ckmBoxBtnUid := uid.CkmBoxIds[req.CkmBoxId].Uid
var err error
if req.Down {
err = fi.PressDownButton(sim.World, ckmBoxBtnUid+"_"+req.ButtonCode)
} else {
err = fi.PressUpButton(sim.World, ckmBoxBtnUid+"_"+req.ButtonCode)
}
if err != nil {
return sys_error.New("车库门控制盒操作失败", err)
} else {
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

@ -44,6 +44,8 @@ type StationUidStructure struct {
PslIds map[uint32]*elementIdStructure
SpksSwitchIds map[uint32]*elementIdStructure
IbpIds map[uint32]*elementIdStructure
CkmIds map[uint32]*elementIdStructure
CkmBoxIds map[uint32]*elementIdStructure
}
type RelayUidStructure struct {
@ -256,6 +258,8 @@ func initStationUid(data *data_proto.RtssGraphicStorage) *StationUidStructure {
PslIds: make(map[uint32]*elementIdStructure, len(data.GateBoxs)),
//SpksSwitchIds: make(map[uint32]*elementIdStructure, len(data.SpksSwitchs)),
IbpIds: make(map[uint32]*elementIdStructure, len(data.IbpBoxs)),
CkmIds: make(map[uint32]*elementIdStructure, len(data.GarageDoors)),
CkmBoxIds: make(map[uint32]*elementIdStructure, len(data.GarageDoors)),
}
city, lineId, _ := getUIdPrefix(data.UniqueIdPrefix)
// 处理车站信息
@ -409,6 +413,15 @@ func initStationUid(data *data_proto.RtssGraphicStorage) *StationUidStructure {
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),
}
}
//// SPKS人员防护
//for _, spk := range data.SpksSwitchs {
// if spk.RefStand == 0 {