示例#1
0
 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);
         }
     }
 }
示例#2
0
        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);
        }
示例#3
0
        /// <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);
        }
示例#4
0
 private void SetVolume(List <Controller_Event_Log> detectorEvents, int binSize)
 {
     Volume = new VolumeCollection(StartDate, EndDate, detectorEvents, binSize);
 }
示例#5
0
 private void SetVolume(List <Models.Controller_Event_Log> detectorEvents, DateTime startDate, DateTime endDate,
                        int binSize)
 {
     volume = new VolumeCollection(startDate, endDate, detectorEvents, binSize);
 }