package message_server import ( "joylink.club/bj-rtsts-server/mqtt" "joylink.club/bj-rtsts-server/ts/protos/graphicData" "joylink.club/bj-rtsts-server/ts/simulation/wayside/memory" ) // 启动仿真所需的消息服务 func Start(vs *memory.VerifySimulation) { for _, mapId := range vs.MapIds { t := memory.QueryGiType(mapId) switch t { case graphicData.PictureType_StationLayout: // 平面布置图 // 添加车站关联的平面布置图、IBP、PSL信息 mqtt.GetMsgClient().PublishTask(vs.SimulationId, NewSfpMs(vs, mapId), NewIBPMs(vs, mapId), NewPSLMs(vs, mapId)) case graphicData.PictureType_RelayCabinetLayout: // 继电器柜 mqtt.GetMsgClient().PublishTask(vs.SimulationId, NewRccMs(vs, mapId)) } } } // 关闭仿真消息服务 func Close(vs *memory.VerifySimulation) { mqtt.GetMsgClient().CloseTask(vs.SimulationId) }