public void CreateTimeMetricYearBinTimePeriodTest() { ApproachCycleAggregationOptions options = new ApproachCycleAggregationOptions(); options.SeriesWidth = 3; options.StartDate = Convert.ToDateTime("1/1/2016"); options.EndDate = Convert.ToDateTime("1/1/2018"); options.SelectedXAxisType = XAxisType.Time; options.SelectedSeries = SeriesType.Signal; options.TimeOptions = new BinFactoryOptions( Convert.ToDateTime("1/1/2016"), Convert.ToDateTime("1/1/2018"), 6, 0, 10, 0, new List <DayOfWeek> { DayOfWeek.Monday, DayOfWeek.Tuesday, DayOfWeek.Wednesday, DayOfWeek.Thursday, DayOfWeek.Friday, DayOfWeek.Saturday, DayOfWeek.Sunday }, BinFactoryOptions.BinSize.Year, BinFactoryOptions.TimeOptions.TimePeriod); foreach (var aggregatedDataType in options.AggregatedDataTypes) { options.SelectedAggregatedDataType = aggregatedDataType; CreateStackedColumnChart(options); } Assert.IsTrue(options.ReturnList.Count > 0); }
public ActionResult GetAggregateDataTypes(int id) { List <AggregatedDataType> AggregatedDataTypes; switch (id) { case 16: AggregatedDataTypes = new DetectorVolumeAggregationOptions().AggregatedDataTypes; break; case 25: AggregatedDataTypes = new ApproachSpeedAggregationOptions().AggregatedDataTypes; break; case 18: AggregatedDataTypes = new ApproachPcdAggregationOptions().AggregatedDataTypes; break; case 19: AggregatedDataTypes = new ApproachCycleAggregationOptions().AggregatedDataTypes; break; case 20: AggregatedDataTypes = new ApproachSplitFailAggregationOptions().AggregatedDataTypes; break; case 26: AggregatedDataTypes = new ApproachYellowRedActivationsAggregationOptions().AggregatedDataTypes; break; case 22: AggregatedDataTypes = new SignalPreemptionAggregationOptions().AggregatedDataTypes; break; case 24: AggregatedDataTypes = new SignalPriorityAggregationOptions().AggregatedDataTypes; break; case 27: AggregatedDataTypes = new SignalEventCountAggregationOptions().AggregatedDataTypes; break; case 28: AggregatedDataTypes = new ApproachEventCountAggregationOptions().AggregatedDataTypes; break; case 29: AggregatedDataTypes = new PhaseTerminationAggregationOptions().AggregatedDataTypes; break; case 30: AggregatedDataTypes = new PhasePedAggregationOptions().AggregatedDataTypes; break; default: throw new Exception("Invalid Metric Type"); break; } return(PartialView(AggregatedDataTypes)); }
public void CreateAllCharts(ApproachCycleAggregationOptions options) { options.SelectedChartType = SeriesChartType.Column; options.SelectedAggregationType = AggregationType.Sum; options.CreateMetric(); options.SelectedAggregationType = AggregationType.Average; options.CreateMetric(); options.SelectedChartType = SeriesChartType.Line; options.SelectedAggregationType = AggregationType.Sum; options.CreateMetric(); options.SelectedAggregationType = AggregationType.Average; options.CreateMetric(); options.SelectedChartType = SeriesChartType.Pie; options.SelectedAggregationType = AggregationType.Sum; options.CreateMetric(); options.SelectedAggregationType = AggregationType.Average; options.CreateMetric(); options.SelectedChartType = SeriesChartType.StackedColumn; options.SelectedAggregationType = AggregationType.Sum; options.CreateMetric(); options.SelectedAggregationType = AggregationType.Average; options.CreateMetric(); options.SelectedChartType = SeriesChartType.StackedArea; options.SelectedAggregationType = AggregationType.Sum; options.CreateMetric(); options.SelectedAggregationType = AggregationType.Average; options.CreateMetric(); }
public CycleAggregationBySignal(ApproachCycleAggregationOptions options, Models.Signal signal) : base( options, signal) { ApproachCycles = new List <CycleAggregationByApproach>(); GetApproachCycleAggregationContainersForAllApporaches(options, signal); LoadBins(null, null); }
public void CreateTimeMetric15MinuteBinTimePeriodTest() { ApproachCycleAggregationOptions options = new ApproachCycleAggregationOptions(); options.SeriesWidth = 3; options.StartDate = Convert.ToDateTime("10/17/2017"); options.EndDate = Convert.ToDateTime("10/18/2017"); options.SelectedXAxisType = XAxisType.Phase; options.SelectedSeries = SeriesType.PhaseNumber; options.TimeOptions = new BinFactoryOptions( Convert.ToDateTime("10/17/2017"), Convert.ToDateTime("10/18/2017"), 6, 0, 10, 0, new List <DayOfWeek> { DayOfWeek.Monday, DayOfWeek.Tuesday, DayOfWeek.Wednesday, DayOfWeek.Thursday, DayOfWeek.Friday, DayOfWeek.Saturday, DayOfWeek.Sunday }, BinFactoryOptions.BinSize.FifteenMinute, BinFactoryOptions.TimeOptions.TimePeriod); options.FilterSignals.Add(new FilterSignal { SignalId = "101", Exclude = false }); options.SelectedChartType = SeriesChartType.Column; options.SelectedAggregationType = AggregationType.Sum; options.CreateMetric(); options.SelectedAggregationType = AggregationType.Average; options.CreateMetric(); options.SelectedChartType = SeriesChartType.Line; options.SelectedAggregationType = AggregationType.Sum; options.CreateMetric(); options.SelectedAggregationType = AggregationType.Average; options.CreateMetric(); options.SelectedChartType = SeriesChartType.Pie; options.SelectedAggregationType = AggregationType.Sum; options.CreateMetric(); options.SelectedAggregationType = AggregationType.Average; options.CreateMetric(); options.SelectedChartType = SeriesChartType.StackedColumn; options.SelectedAggregationType = AggregationType.Sum; options.CreateMetric(); options.SelectedAggregationType = AggregationType.Average; options.CreateMetric(); options.SelectedChartType = SeriesChartType.StackedArea; options.SelectedAggregationType = AggregationType.Sum; options.CreateMetric(); options.SelectedAggregationType = AggregationType.Average; options.CreateMetric(); Assert.IsTrue(options.ReturnList.Count == 10); }
public void CreateTimeMetricYearBinStartToFinishTest() { ApproachCycleAggregationOptions options = new ApproachCycleAggregationOptions(); options.SeriesWidth = 3; options.StartDate = Convert.ToDateTime("1/1/2016"); options.EndDate = Convert.ToDateTime("1/1/2018"); options.SelectedXAxisType = XAxisType.Signal; options.SelectedSeries = SeriesType.Signal; options.TimeOptions = new BinFactoryOptions( Convert.ToDateTime("1/1/2016"), Convert.ToDateTime("1/1/2018"), null, null, null, null, null, BinFactoryOptions.BinSize.Year, BinFactoryOptions.TimeOptions.StartToEnd); options.FilterSignals.Add(new FilterSignal { SignalId = "101", Exclude = false }); options.FilterSignals.Add(new FilterSignal { SignalId = "102", Exclude = false }); options.FilterSignals.Add(new FilterSignal { SignalId = "103", Exclude = false }); options.FilterSignals.Add(new FilterSignal { SignalId = "104", Exclude = false }); options.FilterSignals.Add(new FilterSignal { SignalId = "105", Exclude = false }); options.SelectedChartType = SeriesChartType.Column; options.SelectedAggregationType = AggregationType.Sum; options.CreateMetric(); options.SelectedAggregationType = AggregationType.Average; options.CreateMetric(); options.SelectedChartType = SeriesChartType.Line; options.SelectedAggregationType = AggregationType.Sum; options.CreateMetric(); options.SelectedAggregationType = AggregationType.Average; options.CreateMetric(); options.SelectedChartType = SeriesChartType.Pie; options.SelectedAggregationType = AggregationType.Sum; options.CreateMetric(); options.SelectedAggregationType = AggregationType.Average; options.CreateMetric(); options.SelectedChartType = SeriesChartType.StackedColumn; options.SelectedAggregationType = AggregationType.Sum; options.CreateMetric(); options.SelectedAggregationType = AggregationType.Average; options.CreateMetric(); options.SelectedChartType = SeriesChartType.StackedArea; options.SelectedAggregationType = AggregationType.Sum; options.CreateMetric(); options.SelectedAggregationType = AggregationType.Average; options.CreateMetric(); Assert.IsTrue(options.ReturnList.Count == 10); }
public void SetAggregateData() { switch (SelectedMetricTypeId) { case 16: AggregatedDataTypes = new DetectorVolumeAggregationOptions().AggregatedDataTypes; break; case 18: AggregatedDataTypes = new ApproachPcdAggregationOptions().AggregatedDataTypes; break; case 19: AggregatedDataTypes = new ApproachCycleAggregationOptions().AggregatedDataTypes; break; case 20: AggregatedDataTypes = new ApproachSplitFailAggregationOptions().AggregatedDataTypes; break; case 22: AggregatedDataTypes = new SignalPreemptionAggregationOptions().AggregatedDataTypes; break; case 24: AggregatedDataTypes = new SignalPriorityAggregationOptions().AggregatedDataTypes; break; case 25: AggregatedDataTypes = new ApproachSpeedAggregationOptions().AggregatedDataTypes; break; case 26: AggregatedDataTypes = new ApproachYellowRedActivationsAggregationOptions().AggregatedDataTypes; break; case 27: AggregatedDataTypes = new SignalEventCountAggregationOptions().AggregatedDataTypes; break; case 28: AggregatedDataTypes = new ApproachEventCountAggregationOptions().AggregatedDataTypes; break; default: throw new Exception("Invalid Metric Type"); break; } }
private void GetApproachCycleAggregationContainersForAllApporaches( ApproachCycleAggregationOptions options, Models.Signal signal) { foreach (var approach in signal.Approaches) { ApproachCycles.Add( new CycleAggregationByApproach(approach, options, options.StartDate, options.EndDate, true, options.SelectedAggregatedDataType)); if (approach.PermissivePhaseNumber != null) { ApproachCycles.Add( new CycleAggregationByApproach(approach, options, options.StartDate, options.EndDate, false, options.SelectedAggregatedDataType)); } } }
public void CreateTimeMetric15MinuteBinStartToFinishTest() { ApproachCycleAggregationOptions options = new ApproachCycleAggregationOptions(); options.SeriesWidth = 3; options.StartDate = Convert.ToDateTime("10/17/2017"); options.EndDate = Convert.ToDateTime("10/28/2017"); options.SelectedXAxisType = XAxisType.TimeOfDay; options.SelectedSeries = SeriesType.PhaseNumber; options.TimeOptions = new BinFactoryOptions( Convert.ToDateTime("10/17/2017"), Convert.ToDateTime("10/28/2017"), null, null, null, null, null, BinFactoryOptions.BinSize.FifteenMinute, BinFactoryOptions.TimeOptions.StartToEnd); options.FilterSignals.Add(new FilterSignal { SignalId = "102", Exclude = false }); options.SelectedChartType = SeriesChartType.Column; options.SelectedAggregationType = AggregationType.Sum; options.CreateMetric(); options.SelectedAggregationType = AggregationType.Average; options.CreateMetric(); options.SelectedChartType = SeriesChartType.Line; options.SelectedAggregationType = AggregationType.Sum; options.CreateMetric(); options.SelectedAggregationType = AggregationType.Average; options.CreateMetric(); options.SelectedChartType = SeriesChartType.Pie; options.SelectedAggregationType = AggregationType.Sum; options.CreateMetric(); options.SelectedAggregationType = AggregationType.Average; options.CreateMetric(); options.SelectedChartType = SeriesChartType.StackedColumn; options.SelectedAggregationType = AggregationType.Sum; options.CreateMetric(); options.SelectedAggregationType = AggregationType.Average; options.CreateMetric(); options.SelectedChartType = SeriesChartType.StackedArea; options.SelectedAggregationType = AggregationType.Sum; options.CreateMetric(); options.SelectedAggregationType = AggregationType.Average; options.CreateMetric(); Assert.IsTrue(options.ReturnList.Count == 10); }
public void CreateTimeMetricYearBinStartToFinishTest() { ApproachCycleAggregationOptions options = new ApproachCycleAggregationOptions(); options.SeriesWidth = 3; options.StartDate = Convert.ToDateTime("1/1/2016"); options.EndDate = Convert.ToDateTime("1/1/2018"); options.SelectedXAxisType = XAxisType.Time; options.SelectedSeries = SeriesType.Signal; options.TimeOptions = new BinFactoryOptions( Convert.ToDateTime("1/1/2016"), Convert.ToDateTime("1/1/2018"), null, null, null, null, null, BinFactoryOptions.BinSize.Year, BinFactoryOptions.TimeOptions.StartToEnd); foreach (var aggregatedDataType in options.AggregatedDataTypes) { options.SelectedAggregatedDataType = aggregatedDataType; CreateStackedColumnChart(options); } Assert.IsTrue(options.ReturnList.Count > 0); }
public CycleAggregationBySignal(ApproachCycleAggregationOptions options, Models.Signal signal, DirectionType direction) : base(options, signal) { ApproachCycles = new List <CycleAggregationByApproach>(); foreach (var approach in signal.Approaches) { if (approach.DirectionType.DirectionTypeID == direction.DirectionTypeID) { ApproachCycles.Add( new CycleAggregationByApproach(approach, options, options.StartDate, options.EndDate, true, options.SelectedAggregatedDataType)); if (approach.PermissivePhaseNumber != null) { ApproachCycles.Add( new CycleAggregationByApproach(approach, options, options.StartDate, options.EndDate, false, options.SelectedAggregatedDataType)); } } } LoadBins(null, null); }
private ActionResult GetCycleChart(AggDataExportViewModel aggDataExportViewModel) { ApproachCycleAggregationOptions options = new ApproachCycleAggregationOptions(); return(GetChart(aggDataExportViewModel, options)); }
public void CreateTimeMetricStartToFinishAllBinSizesAllAggregateDataTypesTest() { ApproachCycleAggregationOptions options = new ApproachCycleAggregationOptions(); base.CreateTimeMetricStartToFinishAllBinSizesAllAggregateDataTypesTest(options); }