コード例 #1
0
ファイル: SplitFailPhase.cs プロジェクト: gmonk/ATSPM
 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);
 }
コード例 #2
0
ファイル: DetectorSpeed.cs プロジェクト: gmonk/ATSPM
        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);
        }
コード例 #3
0
ファイル: SplitFailPhase.cs プロジェクト: KimleyHorn/ATSPM
        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);
        }