道岔信号机状态设置的参数添加默认值
This commit is contained in:
parent
4980c14c0b
commit
8313dcd6e1
@ -6,6 +6,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"joylink.club/bj-rtsts-server/dto/request_proto"
|
||||||
"joylink.club/bj-rtsts-server/dto/state_proto"
|
"joylink.club/bj-rtsts-server/dto/state_proto"
|
||||||
"joylink.club/rtsssimulation/repository/model/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) {
|
if entry.HasComponent(appcomponent.SignalParamType) {
|
||||||
signalState.Param = appcomponent.SignalParamType.Get(entry)
|
signalState.Param = appcomponent.SignalParamType.Get(entry)
|
||||||
|
} else {
|
||||||
|
signalState.Param = &request_proto.SignalParam{}
|
||||||
}
|
}
|
||||||
if entry.HasComponent(component.Signal2XH1ElectronicType) { // 2XH1信号机
|
if entry.HasComponent(component.Signal2XH1ElectronicType) { // 2XH1信号机
|
||||||
signal2XH1 := component.Signal2XH1ElectronicType.Get(entry)
|
signal2XH1 := component.Signal2XH1ElectronicType.Get(entry)
|
||||||
@ -391,6 +394,8 @@ func collectTurnoutStates(sim *memory.VerifySimulation, mapId int32) ([]*state_p
|
|||||||
}
|
}
|
||||||
if entry.HasComponent(appcomponent.PointsParamType) {
|
if entry.HasComponent(appcomponent.PointsParamType) {
|
||||||
s.Param = appcomponent.PointsParamType.Get(entry)
|
s.Param = appcomponent.PointsParamType.Get(entry)
|
||||||
|
} else {
|
||||||
|
s.Param = &request_proto.PointsParam{}
|
||||||
}
|
}
|
||||||
// // 强制(联锁驱动无效)
|
// // 强制(联锁驱动无效)
|
||||||
// s.Force = entry.HasComponent(component.TurnoutFaultCiqdType)
|
// s.Force = entry.HasComponent(component.TurnoutFaultCiqdType)
|
||||||
|
Loading…
Reference in New Issue
Block a user