public SplitFailPhase(Approach approach, SplitFailOptions options, bool getPermissivePhase) { Approach = approach; GetPermissivePhase = getPermissivePhase; Cycles = CycleFactory.GetSplitFailCycles(options, approach, getPermissivePhase); SetDetectorActivations(options); AddDetectorActivationsToCycles(); Plans = PlanFactory.GetSplitFailPlans(Cycles, options, Approach); TotalFails = Cycles.Count(c => c.IsSplitFail); Statistics = new Dictionary <string, string>(); Statistics.Add("Total Split Failures", TotalFails.ToString()); SetBinStatistics(options); }
public DetectorSpeed(Models.Detector detector, DateTime startDate, DateTime endDate, int binSize, bool getPermissivePhase) { StartDate = startDate; EndDate = endDate; Cycles = CycleFactory.GetSpeedCycles(startDate, endDate, getPermissivePhase, detector); TotalDetectorHits = Cycles.Sum(c => c.SpeedEvents.Count); Plans = PlanFactory.GetSpeedPlans(Cycles, startDate, endDate, detector.Approach); var movementDelay = 0; if (detector.MovementDelay != null) { movementDelay = detector.MovementDelay.Value; } AvgSpeedBucketCollection = new AvgSpeedBucketCollection(startDate, endDate, binSize, movementDelay, Cycles); }
public SplitFailPhase(Approach approach, SplitFailOptions options, bool getPermissivePhase) { Approach = approach; GetPermissivePhase = getPermissivePhase; PhaseNumberSort = getPermissivePhase ? approach.PermissivePhaseNumber.Value.ToString() + "-1": approach.ProtectedPhaseNumber.ToString() + "-2"; using (var db = new SPM()) { Cycles = CycleFactory.GetSplitFailCycles(options, approach, getPermissivePhase, db); SetDetectorActivations(options, db); AddDetectorActivationsToCycles(); Plans = PlanFactory.GetSplitFailPlans(Cycles, options, Approach, db); } TotalFails = Cycles.Count(c => c.IsSplitFail); Statistics = new Dictionary <string, string>(); Statistics.Add("Total Split Failures", TotalFails.ToString()); SetBinStatistics(options); }