/// <summary> /// 检查远光灯 /// </summary> /// <param name="advancedCarSignal"></param> /// <param name="historyTime"></param> /// <param name="sencods"></param> /// <param name="highBeamCount"></param> /// <returns></returns> public static bool CheckHighBeam(this IAdvancedCarSignal advancedCarSignal, DateTime historyTime, double sencods, int highBeamCount = 1) { var cachedTime = DateTime.Now.AddSeconds(-sencods); var time = cachedTime < historyTime ? historyTime : cachedTime; return(advancedCarSignal.CheckHighBeam(time, highBeamCount)); }
protected override void StopCore() { //喇叭检测 var hasLoudSpeaker = CarSignalSet.Query(StartTime).Any(x => x.Sensor.Loudspeaker); if (!hasLoudSpeaker) { BreakRule(DeductionRuleCodes.RC30212); } //夜间远近光交替 if (Context.ExamTimeMode == ExamTimeMode.Night) { var hasLowAndHighBeam = AdvancedSignal.CheckHighBeam(StartTime); if (!hasLowAndHighBeam) { BreakRule(DeductionRuleCodes.RC41603); } } base.StopCore(); }
/// <summary> /// 检查远光灯 /// </summary> /// <param name="advancedCarSignal"></param> /// <param name="sencods"></param> /// <param name="highBeamCount"></param> /// <returns></returns> public static bool CheckHighBeam(this IAdvancedCarSignal advancedCarSignal, double sencods, int highBeamCount = 1) { var historyTime = DateTime.Now.AddSeconds(-sencods); return(advancedCarSignal.CheckHighBeam(historyTime, highBeamCount)); }