列车前端操作接口,列车连接三方映射接口及ws返回列车连接状态
This commit is contained in:
parent
6958259e03
commit
774355ca4d
|
@ -902,7 +902,7 @@ type TrainConnState struct {
|
|||
|
||||
Conn bool `protobuf:"varint,1,opt,name=conn,proto3" json:"conn,omitempty"`
|
||||
ConnType TrainConnState_TrainConnType `protobuf:"varint,2,opt,name=connType,proto3,enum=state.TrainConnState_TrainConnType" json:"connType,omitempty"`
|
||||
TrainControlMapId uint32 `protobuf:"varint,3,opt,name=TrainControlMapId,proto3" json:"TrainControlMapId,omitempty"`
|
||||
TrainControlMapId uint32 `protobuf:"varint,3,opt,name=TrainControlMapId,proto3" json:"TrainControlMapId,omitempty"` //关联的列车控制mapId
|
||||
}
|
||||
|
||||
func (x *TrainConnState) Reset() {
|
||||
|
|
|
@ -47,7 +47,7 @@ func Start(vs *memory.VerifySimulation) {
|
|||
case data_proto.PictureType_RelayCabinetLayout: // 继电器柜
|
||||
_default.AddTasks(vs.SimulationId, NewRccMs(vs, mapId))
|
||||
case data_proto.PictureType_TrainControlCab:
|
||||
_default.AddTasks(vs.SimulationId, NewTrainControlMs(vs))
|
||||
_default.AddTasks(vs.SimulationId, NewTrainControlMs(vs, mapId))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@ package message_server
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"joylink.club/bj-rtsts-server/dto/data_proto"
|
||||
"joylink.club/bj-rtsts-server/dto/state_proto"
|
||||
"joylink.club/bj-rtsts-server/message_server/ms_api"
|
||||
"joylink.club/bj-rtsts-server/mqtt"
|
||||
|
@ -12,21 +11,21 @@ import (
|
|||
)
|
||||
|
||||
// 综合后备盘IBP消息服务
|
||||
func NewTrainControlMs(vs *memory.VerifySimulation) ms_api.MsgTask {
|
||||
var findMapId int32 = 0
|
||||
for _, d := range vs.MapIds {
|
||||
mapData := memory.QueryGiType(d)
|
||||
if mapData == data_proto.PictureType_TrainControlCab {
|
||||
findMapId = d
|
||||
break
|
||||
func NewTrainControlMs(vs *memory.VerifySimulation, mapId int32) ms_api.MsgTask {
|
||||
/* var findMapId int32 = 0
|
||||
for _, d := range vs.MapIds {
|
||||
mapData := memory.QueryGiType(d)
|
||||
if mapData == data_proto.PictureType_TrainControlCab {
|
||||
findMapId = d
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if findMapId == 0 {
|
||||
slog.Error("未找到对应的列城控制图形")
|
||||
return nil
|
||||
}
|
||||
return ms_api.NewScheduleTask(fmt.Sprintf("地图[%d]列车控制", findMapId), func() error {
|
||||
if findMapId == 0 {
|
||||
slog.Error("未找到对应的列城控制图形")
|
||||
return nil
|
||||
}*/
|
||||
return ms_api.NewScheduleTask(fmt.Sprintf("地图[%d]列车控制", mapId), func() error {
|
||||
allTrainMap := &vs.Memory.Status.TrainStateMap
|
||||
allTrainMap.Range(func(key, value any) bool {
|
||||
trainId := fmt.Sprintf("%v", key)
|
||||
|
|
|
@ -39,8 +39,8 @@ func PublishMapVerifyStructure(graphic *dto.PublishedDto) {
|
|||
message = &data_proto.PslGraphicStorage{}
|
||||
case data_proto.PictureType_IBP:
|
||||
message = &data_proto.IBPGraphicStorage{}
|
||||
/* case data_proto.PictureType_TrainControlCab:
|
||||
message = &data_proto.TccGraphicStorage{}*/
|
||||
case data_proto.PictureType_TrainControlCab:
|
||||
message = &data_proto.TccGraphicStorage{}
|
||||
}
|
||||
|
||||
err := proto.Unmarshal(graphic.Proto, message)
|
||||
|
|
Loading…
Reference in New Issue