diff --git a/message_server/sfp_ms.go b/message_server/sfp_ms.go index 62a6368..ca7c86e 100644 --- a/message_server/sfp_ms.go +++ b/message_server/sfp_ms.go @@ -6,6 +6,7 @@ import ( "strings" "time" + "joylink.club/bj-rtsts-server/dto/request_proto" "joylink.club/bj-rtsts-server/dto/state_proto" "joylink.club/rtsssimulation/repository/model/proto" @@ -242,6 +243,8 @@ func handlerSignalState(w ecs.World, uid string) (*state_proto.SignalState, erro } if entry.HasComponent(appcomponent.SignalParamType) { signalState.Param = appcomponent.SignalParamType.Get(entry) + } else { + signalState.Param = &request_proto.SignalParam{} } if entry.HasComponent(component.Signal2XH1ElectronicType) { // 2XH1信号机 signal2XH1 := component.Signal2XH1ElectronicType.Get(entry) @@ -391,6 +394,8 @@ func collectTurnoutStates(sim *memory.VerifySimulation, mapId int32) ([]*state_p } if entry.HasComponent(appcomponent.PointsParamType) { s.Param = appcomponent.PointsParamType.Get(entry) + } else { + s.Param = &request_proto.PointsParam{} } // // 强制(联锁驱动无效) // s.Force = entry.HasComponent(component.TurnoutFaultCiqdType)