Compare commits

..

2 Commits

Author SHA1 Message Date
tiger_zhou
5da5e324e4 Merge branch 'develop' into local-test
All checks were successful
local-test分支打包构建docker并发布运行 / Docker-Build (push) Successful in 1m32s
2024-04-30 10:15:39 +08:00
tiger_zhou
34aa20ca65 列车默认值 2024-04-30 10:15:20 +08:00

View File

@ -22,6 +22,11 @@ import (
"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 {
return &message.TrainOperationConfig{TrainIndex: trainId, Length: int(trainLen),
DavisParamA: configTrainData.DavisParamA, DavisParamB: configTrainData.DavisParamB,
@ -89,7 +94,11 @@ func AddTrainStateNew(vs *VerifySimulation, status *state_proto.TrainState, conf
status.TailDevicePort = tailDevicePort
//初始化列车参数状态
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 {
status.VobcState.DirectionForward = true
} else {