Esempio n. 1
0
        public AnalysisPhaseCollection(string signalId, DateTime startTime, DateTime endTime)
        {
            var cel   = ControllerEventLogRepositoryFactory.Create();
            var ptedt = cel.GetSignalEventsByEventCodes(signalId, startTime, endTime,
                                                        new List <int> {
                1, 11, 4, 5, 6, 7, 21, 23
            });
            var dapta = cel.GetSignalEventsByEventCodes(signalId, startTime, endTime, new List <int> {
                1
            });
            var phasesInUse = dapta.Where(d => d.EventCode == 1).Select(d => d.EventParam).Distinct();

            Plans = PlanFactory.GetSplitMonitorPlans(startTime, endTime, signalId);
            foreach (var row in phasesInUse)
            {
                var aPhase = new AnalysisPhase(row, signalId, ptedt);
                Items.Add(aPhase);
            }
            OrderPhases();
        }
Esempio n. 2
0
        public AnalysisPhaseCollection(string signalId, DateTime startTime, DateTime endTime, int consecutivecount)
        {
            SignalId = signalId;
            var cel   = ControllerEventLogRepositoryFactory.Create();
            var ptedt = cel.GetSignalEventsByEventCodes(SignalId, startTime, endTime,
                                                        new List <int> {
                1, 11, 4, 5, 6, 7, 21, 23
            });
            var dapta = cel.GetSignalEventsByEventCodes(SignalId, startTime, endTime, new List <int> {
                1
            });

            ptedt = ptedt.OrderByDescending(i => i.Timestamp).ToList();
            var phasesInUse = dapta.Where(r => r.EventCode == 1).Select(r => r.EventParam).Distinct();

            Plans = PlanFactory.GetSplitMonitorPlans(startTime, endTime, SignalId);
            foreach (var row in phasesInUse)
            {
                var aPhase = new AnalysisPhase(row, ptedt, consecutivecount);
                Items.Add(aPhase);
            }
            OrderPhases();
            MaxPhaseInUse = FindMaxPhase(Items);
        }