public VolumeCollection(VolumeCollection primaryDirectionVolume, VolumeCollection opposingDirectionVolume, int binSize) { if (primaryDirectionVolume != null && opposingDirectionVolume != null) { for (int i = 0; i < primaryDirectionVolume.Items.Count; i++) { Volume primaryBin = primaryDirectionVolume.Items[i]; Volume opposingBin = opposingDirectionVolume.Items[i]; Volume totalBin = new Volume(primaryBin.StartTime, primaryBin.EndTime, binSize); totalBin.DetectorCount = primaryBin.DetectorCount + opposingBin.DetectorCount; Items.Add(totalBin); } } }
public void LinkPivotAddSeconds(int seconds) { totalArrivalOnRed = -1; totalVolume = -1; totalGreenTime = -1; totalArrivalOnGreen = -1; this.volume = null; DateTime redLightTimeStamp = DateTime.MinValue; foreach (MOE.Common.Models.Controller_Event_Log row in detectorEvents) { row.Timestamp = row.Timestamp.AddSeconds(seconds); } plans.LinkPivotAddDetectorData(this.detectorEvents); }
/// <summary> /// Default constructor for the Detector class use in the Turning Movement Count Charts /// </summary> /// <param name="detid"></param> /// <param name="signalid"></param> /// <param name="channelid"></param> /// <param name="laneid"></param> /// <param name="approachdirection"></param> /// <param name="startDate"></param> /// <param name="endDate"></param> /// <param name="binsize"></param> public Detector(Models.Detector detector, DateTime startDate, DateTime endDate, int binsize) { DetID = detector.DetectorID; Channel = detector.DetChannel; Approach = detector.Approach; SignalID = detector.Approach.SignalID; LaneType = detector.LaneType; var celRepository = ControllerEventLogRepositoryFactory.Create(); var detectorEvents = new List <Controller_Event_Log>(); detectorEvents.AddRange(celRepository.GetEventsByEventCodesParam(detector.Approach.SignalID, startDate, endDate, new List <int> { 82 }, Channel)); Volumes = new VolumeCollection(startDate, endDate, detectorEvents, binsize); }
private void SetVolume(List <Controller_Event_Log> detectorEvents, int binSize) { Volume = new VolumeCollection(StartDate, EndDate, detectorEvents, binSize); }
private void SetVolume(List <Models.Controller_Event_Log> detectorEvents, DateTime startDate, DateTime endDate, int binSize) { volume = new VolumeCollection(startDate, endDate, detectorEvents, binSize); }