列车pc仿真调整

This commit is contained in:
tiger_zhou 2024-05-07 15:09:08 +08:00
parent 4f8eab5a7a
commit a298e11da2
2 changed files with 3 additions and 3 deletions

View File

@ -52,7 +52,7 @@ func findTrainTccGraphicDataHandler(tccG *data_proto.TccGraphicStorage, id uint3
}
// 初始化列车控制数据
func initTrainTcc(vs *VerifySimulation, runDir bool) *state_proto.TrainControlState {
func initTrainTcc(vs *VerifySimulation) *state_proto.TrainControlState {
var tccGI *data_proto.TccGraphicStorage
for _, id := range vs.MapIds {
if QueryGiType(id) == data_proto.PictureType_TrainControlCab {
@ -82,7 +82,7 @@ func initTrainTcc(vs *VerifySimulation, runDir bool) *state_proto.TrainControlSt
}
ds = append(ds, &state_proto.TrainControlState_DriverKeySwitch{Id: b.Common.Id, Val: val})
} else if b.GetType() == data_proto.TccKey_frontAndRearDirectionalControl {
tcc.DirKey = &state_proto.TrainControlState_DirectionKeySwitch{Id: b.Common.Id, Val: uint32(message.IsTrue(runDir))}
tcc.DirKey = &state_proto.TrainControlState_DirectionKeySwitch{Id: b.Common.Id, Val: uint32(message.IsTrue(true))}
}
}
tcc.DriverKey = ds

View File

@ -100,7 +100,7 @@ func AddTrainStateNew(vs *VerifySimulation, status *state_proto.TrainState, conf
}
status.VobcState = &state_proto.TrainVobcState{Tc1Active: true, TrainLoad: int64(tl), BrakingStatus: true, BrakeForce: DEFAULT_BRAKE_FORCE, DirectionForward: true}
status.Tcc = initTrainTcc(vs, status.RunDirection)
status.Tcc = initTrainTcc(vs)
slog.Debug("列车初始化", "trainIndex", trainIndex, "linkId", linkId, "loffset", loffset)
linkIdInt, _ := strconv.Atoi(linkId)