protected virtual void ProcessDistance(CarSignalInfo signalInfo) { if (ExamContext == null) { return; } if (ExamContext.IsExaming) { MileageUpdator.Execute(signalInfo); signalInfo.Distance = MileageUpdator.Distance; ExamContext.TravlledDistance = signalInfo.Distance; } else { //todo:经常起步不能结束,原因,一点开始考试会先给距离附上上一次结束考试时的MileageUpdator.Distance, //然后再重置MileageUpdator.Distance=0,所以造成不能结束问题 MileageUpdator.Reset(); // Logger.Error("ProcessDistanceError","ExamContextIsNotExaming"); signalInfo.Distance = 0; } }
private void OnExamStart(ExamStartMessage message) { MileageUpdator.Reset(); ExamContext = message.ExamContext; }