Example #1
0
        protected override void ExecuteCore(CarSignalInfo signalInfo)
        {
            //在准备距离不检测
            if (signalInfo.Distance - StraightDrivingStartDistance < Settings.StraightDrivingPrepareDistance)
            {
                return;
            }

            ///停车不检测角度
            if (signalInfo.CarState == CarState.Stop)
            {
                return;
            }
            //判断是否超过速度限制,20160406
            if (Settings.StraightDrivingSpeedMinLimit > 0 && signalInfo.SpeedInKmh < Settings.StraightDrivingSpeedMinLimit)
            {
                Logger.Error("blow DrivingSpeedMinLimit");
                IsUnderSpeedMinLimit = true;
            }

            if (Settings.StraightDrivingReachSpeed > 0 && signalInfo.SpeedInKmh > Settings.StraightDrivingReachSpeed)
            {
                IsReachSpeed = true;
            }
            //
            if (Settings.StraightDrivingSpeedMaxLimit > 0 &&
                signalInfo.SpeedInKmh > Settings.StraightDrivingSpeedMaxLimit)
            {
                IsAboveSpeedMaxLimit = true;
            }
            //
            //直线行驶开始时间,开始的时候记录时间
            if (!StraightDrivingStartTime.HasValue)
            {
                if (signalInfo.BearingAngle.IsValidAngle())
                {
                    StraightDrivingStartOffsetAngle = signalInfo.BearingAngle;
                    StraightDrivingStartTime        = DateTime.Now;
                }
            }
            //如果角度无效返回不检测
            if (!signalInfo.BearingAngle.IsValidAngle() || !StraightDrivingStartOffsetAngle.IsValidAngle())
            {
                return;
            }

            if (!IsBroken_RC40301 && Settings.StraightDrivingMaxOffsetAngle > 0 &&
                !GeoHelper.IsBetweenDiffAngle(signalInfo.BearingAngle, StraightDrivingStartOffsetAngle, Settings.StraightDrivingMaxOffsetAngle))
            {
                IsBroken_RC40301 = true;
                //当偏移角度过大时触发规则
                BreakRule(DeductionRuleCodes.RC40301);
                return;
            }

            base.ExecuteCore(signalInfo);
        }
Example #2
0
        protected override void ExecuteCore(CarSignalInfo signalInfo)
        {
            //乱打灯不扣分,20160323,李
            ////乱打转向灯扣10分
            if (!isSpeakIndicator && (CarSignalSet.Query(StartTime).Count(d => d.Sensor.LeftIndicatorLight) >= Constants.ErrorSignalCount ||
                                      CarSignalSet.Query(StartTime).Count(d => d.Sensor.RightIndicatorLight) >= Constants.ErrorSignalCount))
            {
                isSpeakIndicator = true;
                BreakRule(DeductionRuleCodes.RC40212);
            }

            //在准备距离不检测
            if (signalInfo.Distance - StraightDrivingStartDistance < Settings.StraightDrivingPrepareDistance)
            {
                return;
            }

            //直线行驶开始时间,开始的时候记录时间
            if (!StraightDrivingStartTime.HasValue)
            {
                if (signalInfo.BearingAngle.IsValidAngle())
                {
                    StraightDrivingStartOffsetAngle = signalInfo.BearingAngle;
                    StraightDrivingStartTime        = DateTime.Now;
                }
            }
            //如果角度无效返回不检测
            if (!signalInfo.BearingAngle.IsValidAngle() || !StraightDrivingStartOffsetAngle.IsValidAngle())
            {
                return;
            }

            if (!IsBroken_RC40301 && Settings.StraightDrivingMaxOffsetAngle > 0 &&
                !GeoHelper.IsBetweenDiffAngle(signalInfo.BearingAngle, StraightDrivingStartOffsetAngle, Settings.StraightDrivingMaxOffsetAngle))
            {
                IsBroken_RC40301 = true;
                //当偏移角度过大时触发规则
                BreakRule(DeductionRuleCodes.RC40301);
                return;
            }



            base.ExecuteCore(signalInfo);
        }