Пример #1
0
        private void AddTitleAndLegend(Chart chart, int PreemptNumber)
        {
            chart.ImageStorageMode       = ImageStorageMode.UseImageLocation;
            chart.ImageType              = ChartImageType.Jpeg;
            chart.Height                 = 350;
            chart.Width                  = 1100;
            chart.BorderSkin.SkinStyle   = BorderSkinStyle.None;
            chart.BorderSkin.BorderColor = Color.Black;
            chart.BorderSkin.BorderWidth = 1;

            //Set the chart title
            chart.Titles.Add(ChartTitleFactory.GetChartName(Options.MetricTypeID));
            chart.Titles.Add(ChartTitleFactory.GetSignalLocationAndDateRange(Options.SignalID,
                                                                             Options.StartDate, Options.EndDate));
            if (PreemptNumber > 0)
            {
                chart.Titles.Add(ChartTitleFactory.GetBoldTitle(" Preempt Number: " + PreemptNumber.ToString()));
            }

            //Create the chart legend
            Legend chartLegend = new Legend();

            chartLegend.Name    = "MainLegend";
            chartLegend.Docking = Docking.Left;
            chart.Legends.Add(chartLegend);
        }
Пример #2
0
 private void SetChartTitle(Chart chart)
 {
     chart.Titles.Add(ChartTitleFactory.GetChartName(this.MetricTypeID));
     chart.Titles.Add(ChartTitleFactory.GetSignalLocationAndDateRange(this.SignalID, this.StartDate, this.EndDate));
     chart.Titles.Add(ChartTitleFactory.GetTitle("Currently showing Force-Offs, Max-Outs and Gap-Outs with a consecutive occurrence of " +
                                                 this.SelectedConsecutiveCount.ToString() + " or more. \n  Pedestrian events are never filtered"));
 }
Пример #3
0
 private void SetChartTitle(Dictionary <string, string> statistics)
 {
     chart.Titles.Add(ChartTitleFactory.GetChartName(Options.MetricTypeID));
     chart.Titles.Add(ChartTitleFactory.GetSignalLocationAndDateRange(Options.SignalID, Options.StartDate, Options.EndDate));
     chart.Titles.Add(ChartTitleFactory.GetPhaseAndPhaseDescriptions(Phase.PhaseNumber, Phase.Approach.DirectionType.Description));
     chart.Titles.Add(ChartTitleFactory.GetStatistics(statistics));
 }
Пример #4
0
 private void SetChartTitle(string direction1, string direction2)
 {
     Chart.Titles.Add(ChartTitleFactory.GetChartName(Options.MetricTypeID));
     Chart.Titles.Add(ChartTitleFactory.GetSignalLocationAndDateRange(
                          Options.SignalID, Options.StartDate, Options.EndDate));
     Chart.Titles.Add(ChartTitleFactory.GetBoldTitle(direction1 + " and " + direction2 + " Approaches"));
 }
Пример #5
0
 private void SetChartTitle(Dictionary <string, string> statistics)
 {
     Chart.Titles.Add(ChartTitleFactory.GetChartName(Options.MetricTypeID));
     Chart.Titles.Add(
         ChartTitleFactory.GetSignalLocationAndDateRange(Options.SignalID, Options.StartDate, Options.EndDate));
     Chart.Titles.Add(ChartTitleFactory.GetPhaseAndPhaseDescriptions(SplitFailPhase.Approach, SplitFailPhase.GetPermissivePhase));
     Chart.Titles.Add(ChartTitleFactory.GetStatistics(statistics));
 }
Пример #6
0
 private void SetChartTitle(Models.LaneType laneType, Models.DirectionType direction, Models.MovementType movementType)
 {
     chart.Titles.Add(ChartTitleFactory.GetChartName(Options.MetricTypeID));
     chart.Titles.Add(ChartTitleFactory.GetSignalLocationAndDateRange(
                          Options.SignalID, Options.StartDate, Options.EndDate));
     chart.Titles.Add(ChartTitleFactory.GetBoldTitle(direction.Description + " " +
                                                     movementType.Description + " " + laneType.Description + " Lanes"));
 }
 private void SetChartTitle(TimingAndActuationsOptions options)
 {
     Chart.ChartAreas[0].AxisY.Title    = "";
     Chart.ChartAreas[0].AxisY2.Enabled = AxisEnabled.False;
     Chart.ChartAreas[0].AxisY2.Title   = "";
     Chart.Titles.Add(ChartTitleFactory.GetChartName(options.MetricTypeID));
     Chart.Titles.Add(ChartTitleFactory.GetSignalLocationAndDateRange(
                          options.SignalID, options.StartDate, options.EndDate));
 }
Пример #8
0
 private void SetChartTitles(Chart chart, MOE.Common.Models.Detector detector)
 {
     chart.Titles.Add(ChartTitleFactory.GetChartName(this.MetricTypeID));
     chart.Titles.Add(ChartTitleFactory.GetSignalLocationAndDateRange(
                          this.SignalID, this.StartDate, this.EndDate));
     chart.Titles.Add(ChartTitleFactory.GetPhaseAndPhaseDescriptions(detector.Approach.ProtectedPhaseNumber, detector.Approach.DirectionType.Description));
     chart.Titles.Add(ChartTitleFactory.GetTitle("Detection Type: " + detector.DetectionHardware.Name + "; Speed Accuracy +/- 2 mph" + "\n" + "Detector Distance from Stop Bar: " + detector.DistanceFromStopBar.ToString() + " feet; "
                                                 + "\n" + "Includes records over 5mph that occur between 15s after start of green to start of yellow."));
 }
Пример #9
0
        private void SetChartTitle(Chart chart, Approach approach, Dictionary <string, string> statistics)
        {
            var    detectorsForMetric = approach.GetDetectorsForMetricType(this.MetricTypeID);
            string message            = "\n Advanced detector located " + detectorsForMetric.FirstOrDefault().DistanceFromStopBar.ToString() + " ft. upstream of stop bar";

            chart.Titles.Add(ChartTitleFactory.GetChartName(this.MetricTypeID));
            chart.Titles.Add(ChartTitleFactory.GetSignalLocationAndDateRangeAndMessage(approach.SignalID, this.StartDate, this.EndDate, message));
            chart.Titles.Add(ChartTitleFactory.GetPhaseAndPhaseDescriptions(approach.ProtectedPhaseNumber, approach.DirectionType.Description));
            chart.Titles.Add(ChartTitleFactory.GetStatistics(statistics));
        }
Пример #10
0
 private void SetChartTitles(Chart chart, Models.Detector detector)
 {
     chart.Titles.Add(ChartTitleFactory.GetChartName(MetricTypeID));
     chart.Titles.Add(ChartTitleFactory.GetSignalLocationAndDateRange(
                          SignalID, StartDate, EndDate));
     chart.Titles.Add(ChartTitleFactory.GetPhaseAndPhaseDescriptions(detector.Approach, false));
     chart.Titles.Add(ChartTitleFactory.GetTitle("Detection Type: " + detector.DetectionHardware.Name +
                                                 "; Speed Accuracy +/- 2 mph" + "\n" +
                                                 "Detector Distance from Stop Bar: " +
                                                 detector.DistanceFromStopBar + " feet; "
                                                 + "\n" +
                                                 "Includes records over 5mph that occur between 15s after start of green to start of yellow."));
 }
Пример #11
0
        private void SetChartTitle(Chart chart, SignalPhase signalPhase, Dictionary <string, string> statistics)
        {
            var detectorsForMetric = signalPhase.Approach.GetDetectorsForMetricType(MetricTypeID);
            var message            = "\n Advanced detector located " + detectorsForMetric.FirstOrDefault().DistanceFromStopBar +
                                     " ft. upstream of stop bar";

            chart.Titles.Add(ChartTitleFactory.GetChartName(MetricTypeID));
            chart.Titles.Add(
                ChartTitleFactory.GetSignalLocationAndDateRangeAndMessage(signalPhase.Approach.SignalID, StartDate, EndDate,
                                                                          message));
            chart.Titles.Add(ChartTitleFactory.GetPhaseAndPhaseDescriptions(signalPhase.Approach, signalPhase.GetPermissivePhase));
            chart.Titles.Add(ChartTitleFactory.GetStatistics(statistics));
        }
Пример #12
0
 private void SetChartTitle(LaneType laneType, DirectionType direction, MovementType movementType)
 {
     chart.Titles.Add(ChartTitleFactory.GetChartName(Options.MetricTypeID));
     chart.Titles.Add(ChartTitleFactory.GetSignalLocationAndDateRange(
                          Options.SignalID, Options.StartDate, Options.EndDate));
     chart.Titles.Add(ChartTitleFactory.GetBoldTitle(direction.Description + " " +
                                                     movementType.Description + " " + laneType.Description +
                                                     " Lanes"));
     if (movementType.MovementTypeID == 2 || movementType.MovementTypeID == 3)
     {
         chart.ChartAreas[0].AxisY.Maximum = Options.Y2AxisMax.Value;
     }
 }
Пример #13
0
        private void SetChartTitle(Chart chart, PedPhase pp, PedDelayOptions options)
        {
            chart.Titles.Add(ChartTitleFactory.GetChartName(options.MetricTypeID));
            chart.Titles.Add(ChartTitleFactory.GetSignalLocationAndDateRange(
                                 options.SignalID, options.StartDate, options.EndDate));
            chart.Titles.Add(ChartTitleFactory.GetPhase(pp.PhaseNumber));
            var statistics = new Dictionary <string, string>();

            statistics.Add("Ped Actuations(PA)", pp.PedActuations.ToString());
            statistics.Add("Min Delay", DateTime.Today.AddMinutes(pp.MinDelay / 60).ToString("mm:ss"));
            statistics.Add("Max Delay", DateTime.Today.AddMinutes(pp.MaxDelay / 60).ToString("mm:ss"));
            statistics.Add("Average Delay(AD)", DateTime.Today.AddMinutes(pp.AverageDelay / 60).ToString("mm:ss"));
            chart.Titles.Add(ChartTitleFactory.GetStatistics(statistics));
        }
Пример #14
0
        //public static void SetSimplePlanStrips(List<Plan> plans, Chart chart, DateTime startDate, ControllerEventLogs eventLog)
        //{
        //    int backGroundColor = 1;
        //    foreach (Plan plan in plans)
        //    {
        //        StripLine stripline = new StripLine();
        //        //Creates alternating backcolor to distinguish the plans
        //        if (backGroundColor % 2 == 0)
        //        {
        //            stripline.BackColor = Color.FromArgb(120, Color.LightGray);
        //        }
        //        else
        //        {
        //            stripline.BackColor = Color.FromArgb(120, Color.LightBlue);
        //        }

        //        //Set the stripline properties
        //        stripline.IntervalOffsetType = DateTimeIntervalType.Hours;
        //        stripline.Interval = 1;
        //        stripline.IntervalOffset = (plan.StartTime - startDate).TotalHours;
        //        stripline.StripWidth = (plan.EndTime - plan.StartTime).TotalHours;
        //        stripline.StripWidthType = DateTimeIntervalType.Hours;

        //        chart.ChartAreas["ChartArea1"].AxisX.StripLines.Add(stripline);

        //        //Add a corrisponding custom label for each strip
        //        CustomLabel plannumberlabel = new CustomLabel();
        //        plannumberlabel.FromPosition = plan.StartTime.ToOADate();
        //        plannumberlabel.ToPosition = plan.EndTime.ToOADate();
        //        switch (plan.PlanNumber)
        //        {
        //            case 254:
        //                plannumberlabel.Text = "Free";
        //                break;
        //            case 255:
        //                plannumberlabel.Text = "Flash";
        //                break;
        //            case 0:
        //                plannumberlabel.Text = "Unknown";
        //                break;
        //            default:
        //                plannumberlabel.Text = "Plan " + plan.PlanNumber.ToString();

        //                break;
        //        }
        //        plannumberlabel.LabelMark = LabelMarkStyle.LineSideMark;
        //        plannumberlabel.ForeColor = Color.Black;
        //        plannumberlabel.RowIndex = 6;


        //        chart.ChartAreas[0].AxisX2.CustomLabels.Add(plannumberlabel);

        //        CustomLabel planPreemptsLabel = new CustomLabel();
        //        planPreemptsLabel.FromPosition = plan.StartTime.ToOADate();
        //        planPreemptsLabel.ToPosition = plan.EndTime.ToOADate();

        //        var c = from Models.Controller_Event_Log r in eventLog.Events
        //                where r.EventCode == 107 && r.Timestamp > plan.StartTime && r.Timestamp < plan.EndTime
        //                select r;


        //        string premptCount = c.Count().ToString();
        //        planPreemptsLabel.Text = "Preempts Serviced During Plan: " + premptCount;
        //        planPreemptsLabel.LabelMark = LabelMarkStyle.LineSideMark;
        //        planPreemptsLabel.ForeColor = Color.Red;
        //        planPreemptsLabel.RowIndex = 7;

        //        chart.ChartAreas[0].AxisX2.CustomLabels.Add(planPreemptsLabel);

        //        backGroundColor++;

        //    }
        //}

        private void AddTitleAndLegend(Chart chart, int preemptNumber)
        {
            ChartFactory.SetImageProperties(chart);
            chart.BorderSkin.SkinStyle   = BorderSkinStyle.None;
            chart.BorderSkin.BorderColor = Color.Black;
            chart.BorderSkin.BorderWidth = 1;

            //Set the chart title
            chart.Titles.Add(ChartTitleFactory.GetChartName(Options.MetricTypeID));
            chart.Titles.Add(ChartTitleFactory.GetSignalLocationAndDateRange(Options.SignalID,
                                                                             Options.StartDate, Options.EndDate));
            if (preemptNumber > 0)
            {
                chart.Titles.Add(ChartTitleFactory.GetBoldTitle(" Preempt Number: " + preemptNumber));
            }

            //Create the chart legend
            var chartLegend = new Legend();

            chartLegend.Name    = "MainLegend";
            chartLegend.Docking = Docking.Left;
            chart.Legends.Add(chartLegend);
        }
Пример #15
0
 private void SetChartTitle(Chart chart, int phase)
 {
     chart.Titles.Add(ChartTitleFactory.GetChartName(this.MetricTypeID));
     chart.Titles.Add(ChartTitleFactory.GetSignalLocationAndDateRange(this.SignalID, this.StartDate, this.EndDate));
     chart.Titles.Add(ChartTitleFactory.GetPhase(phase));
 }
Пример #16
0
 private void SetChartTitle()
 {
     PreemptServiceRequestChart.Titles.Add(ChartTitleFactory.GetChartName(Options.MetricTypeID));
     PreemptServiceRequestChart.Titles.Add(
         ChartTitleFactory.GetSignalLocationAndDateRange(Options.SignalID, Options.StartDate, Options.EndDate));
 }