Compare commits
2 Commits
7fc152ad67
...
5da5e324e4
Author | SHA1 | Date | |
---|---|---|---|
|
5da5e324e4 | ||
|
34aa20ca65 |
@ -22,6 +22,11 @@ import (
|
|||||||
"joylink.club/bj-rtsts-server/dto/state_proto"
|
"joylink.club/bj-rtsts-server/dto/state_proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
DEFULAT_TRAIN_LOAD = 160
|
||||||
|
DEFAULT_BRAKE_FORCE = 19040
|
||||||
|
)
|
||||||
|
|
||||||
func CreateMsgTrainConfig(trainId int, trainLen int64, configTrainData dto.ConfigTrainData) *message.TrainOperationConfig {
|
func CreateMsgTrainConfig(trainId int, trainLen int64, configTrainData dto.ConfigTrainData) *message.TrainOperationConfig {
|
||||||
return &message.TrainOperationConfig{TrainIndex: trainId, Length: int(trainLen),
|
return &message.TrainOperationConfig{TrainIndex: trainId, Length: int(trainLen),
|
||||||
DavisParamA: configTrainData.DavisParamA, DavisParamB: configTrainData.DavisParamB,
|
DavisParamA: configTrainData.DavisParamA, DavisParamB: configTrainData.DavisParamB,
|
||||||
@ -89,7 +94,11 @@ func AddTrainStateNew(vs *VerifySimulation, status *state_proto.TrainState, conf
|
|||||||
status.TailDevicePort = tailDevicePort
|
status.TailDevicePort = tailDevicePort
|
||||||
//初始化列车参数状态
|
//初始化列车参数状态
|
||||||
createOrUpdateStateDynamicConfig(status, configTrainData, trainEndsA, trainEndsB)
|
createOrUpdateStateDynamicConfig(status, configTrainData, trainEndsA, trainEndsB)
|
||||||
status.VobcState = &state_proto.TrainVobcState{Tc1Active: true, TrainLoad: int64(configTrainData.TrainLoad), BrakingStatus: true, BrakeForce: 19040}
|
tl := configTrainData.TrainLoad
|
||||||
|
if tl <= 0 {
|
||||||
|
tl = DEFULAT_TRAIN_LOAD
|
||||||
|
}
|
||||||
|
status.VobcState = &state_proto.TrainVobcState{Tc1Active: true, TrainLoad: int64(tl), BrakingStatus: true, BrakeForce: DEFAULT_BRAKE_FORCE}
|
||||||
if status.RunDirection {
|
if status.RunDirection {
|
||||||
status.VobcState.DirectionForward = true
|
status.VobcState.DirectionForward = true
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user