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); } }
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(); }
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)); }