Esempio n. 1
0
 public PedDelaySignal(string signalID, DateTime startDate,
                       DateTime endDate)
 {
     _SignalID  = signalID;
     _StartDate = startDate;
     _EndDate   = endDate;
     try
     {
         _Plans = new PlansBase(signalID, startDate, endDate);
         var pedPhaseNumbers = ControllerEventLogs.GetPedPhases(signalID, startDate, endDate);
         ConcurrentBag <PedPhase> pedPhases = new ConcurrentBag <PedPhase>();
         Parallel.ForEach(pedPhaseNumbers, currentPhase =>
                          //foreach(int currentPhase in pedPhaseNumbers)
         {
             var pedPhase = new PedPhase(currentPhase, signalID, startDate, endDate, _Plans);
             pedPhases.Add(pedPhase);
         });
         _PedPhases = pedPhases.OrderBy(x => x.PhaseNumber).ToList();
     }
     catch (Exception e)
     {
         var errorLog = ApplicationEventRepositoryFactory.Create();
         errorLog.QuickAdd(System.Reflection.Assembly.GetExecutingAssembly().GetName().ToString(),
                           this.GetType().DisplayName(), e.TargetSite.ToString(), ApplicationEvent.SeverityLevels.High, e.Message);
     }
 }
Esempio n. 2
0
        public PedDelaySignal(string signalID, DateTime startDate,
                              DateTime endDate)
        {
            _SignalID  = signalID;
            _StartDate = startDate;
            _EndDate   = endDate;

            _Plans = new PlansBase(signalID, startDate, endDate);

            var pedPhaseNumbers = ControllerEventLogs.GetPedPhases(signalID, startDate, endDate);

            Parallel.ForEach(pedPhaseNumbers, currentPhase =>
                             //foreach(int currentPhase in pedPhaseNumbers)
            {
                _PedPhases.Add(new PedPhase(currentPhase, signalID, startDate, endDate, _Plans));
            }
                             );
            _PedPhases = _PedPhases.OrderBy(x => x.PhaseNumber).ToList();
        }
Esempio n. 3
0
        public PedDelaySignal(string signalID, DateTime startDate,
                              DateTime endDate)
        {
            _SignalID  = signalID;
            _StartDate = startDate;
            _EndDate   = endDate;

            _Plans = new PlansBase(signalID, startDate, endDate);

            List <int> pedPhaseNumbers = ControllerEventLogs.GetPedPhases(signalID, startDate, endDate);

            Parallel.ForEach(pedPhaseNumbers, currentPhase =>
                             //foreach(int currentPhase in pedPhaseNumbers)
            {
                _PedPhases.Add(new PedPhase(currentPhase, signalID, startDate, endDate, _Plans));
            }
                             );
            _PedPhases.Sort((x, y) => x.PhaseNumber.CompareTo(y.PhaseNumber));
        }