public ControllerEventLogs CombineDetectorDataByApproachAndType(DateTime startDate, DateTime endDate, MOE.Common.Models.Approach approach, bool Has_PCD, bool Has_TMC) { MOE.Common.Models.Repositories.IDetectorRepository gr = MOE.Common.Models.Repositories.DetectorRepositoryFactory.Create(); string signalId = approach.SignalID; if (Has_TMC) { ApproachCountDetectors.Clear(); ApproachCountDetectors.AddRange(RemoveExitDetectors(approach.GetDetectorsForMetricType(5))); } if (Has_PCD) { ApproachCountDetectors.Clear(); ApproachCountDetectors.AddRange(RemoveExitDetectors(approach.GetDetectorsForMetricType(6))); } List <ControllerEventLogs> eventsList = new List <ControllerEventLogs>(); ControllerEventLogs MergedEvents = new ControllerEventLogs(signalId, startDate, endDate); foreach (Models.Detector detector in ApproachCountDetectors) { List <int> li = new List <int> { 82 }; ControllerEventLogs cs = new ControllerEventLogs(signalId, startDate, endDate, detector.DetChannel, li); eventsList.Add(cs); } foreach (ControllerEventLogs Events in eventsList) { MergedEvents.MergeEvents(Events); } return(MergedEvents); }
/// <summary> /// Default constructor for the DetectorCollection used in the Turning Movement Counts charts /// </summary> /// <param name="signalID"></param> /// <param name="startdate"></param> /// <param name="enddate"></param> /// <param name="binsize"></param> public RLMDetectorCollection(DateTime startdate, DateTime enddate, int binsize, MOE.Common.Models.Approach approach) { var dets = approach.GetDetectorsForMetricType(11); foreach (MOE.Common.Models.Detector detector in dets) { MOE.Common.Business.Detector Detector = new Detector(detector, startdate, enddate, binsize); DetectorsForRLM.Add(Detector); } //SortDetectors(); }
/// <summary> /// Alternate Constructor for PCD type data. /// </summary> /// <param name="signalid"></param> /// <param name="approach"></param> public DetectorCollection(MOE.Common.Models.Approach approach) { _signalId = approach.SignalID; MOE.Common.Models.Repositories.ISignalsRepository repository = MOE.Common.Models.Repositories.SignalsRepositoryFactory.Create(); var PCDDetectors = approach.GetDetectorsForMetricType(6); foreach (MOE.Common.Models.Detector row in PCDDetectors) { MOE.Common.Business.Detector Detector = new Detector(row); Items.Add(Detector); } }