Exemplo n.º 1
0
        private void GetSignalPhaseData(DateTime startDate, DateTime endDate, bool usePermissivePhase, SPM db)
        {
            if (!usePermissivePhase)
            {
                PhaseNumber = Approach.ProtectedPhaseNumber;
            }
            else
            {
                PhaseNumber = Approach.PermissivePhaseNumber ?? 0;
            }
            var controllerRepository =
                ControllerEventLogRepositoryFactory.Create(db);

            TotalVolume = controllerRepository.GetTmcVolume(startDate, endDate, Approach.SignalID, PhaseNumber);
            var cycleEvents = controllerRepository.GetEventsByEventCodesParam(Approach.SignalID,
                                                                              startDate, endDate, new List <int> {
                1, 8, 9, 10, 11
            }, PhaseNumber);

            Plans = new RLMPlanCollection(cycleEvents, startDate, endDate, SevereRedLightViolationSeconds, Approach, db);
            if (Plans.PlanList.Count == 0)
            {
                Plans.AddItem(new RLMPlan(startDate, endDate, 0, cycleEvents, SevereRedLightViolationSeconds,
                                          Approach));
            }
        }
Exemplo n.º 2
0
        private void GetSignalOverlapData(DateTime startDate, DateTime endDate, bool showVolume, int binSize, SPM db)
        {
            var redLightTimeStamp = DateTime.MinValue;
            var li = new List <int> {
                62, 63, 64
            };
            var controllerRepository =
                ControllerEventLogRepositoryFactory.Create();
            var cycleEvents = controllerRepository.GetEventsByEventCodesParam(Approach.SignalID,
                                                                              startDate, endDate, li, Approach.ProtectedPhaseNumber);

            Plans = new RLMPlanCollection(cycleEvents, startDate, endDate, SevereRedLightViolationSeconds, Approach, db);
            if (Plans.PlanList.Count == 0)
            {
                Plans.AddItem(new RLMPlan(startDate, endDate, 0, cycleEvents, SevereRedLightViolationSeconds,
                                          Approach));
            }
        }