コード例 #1
0
 public ActionResult GetTMCMetric(MOE.Common.Business.WCFServiceLibrary.TMCOptions metricOptions)
 {
     metricOptions.MetricType = GetMetricType(metricOptions.MetricTypeID);
     //string[] result = new string[1] { "" };
     MOE.Common.Business.TMC.TMCInfo      tmcInfo = new MOE.Common.Business.TMC.TMCInfo();
     MOE.Common.Business.TMC.TMCViewModel tmcvm   = new MOE.Common.Business.TMC.TMCViewModel(
         metricOptions.ShowLaneVolumes, metricOptions.ShowDataTable);
     if (ModelState.IsValid)
     {
         MetricGeneratorService.MetricGeneratorClient client =
             new MetricGeneratorService.MetricGeneratorClient();
         try
         {
             client.Open();
             tmcInfo = client.CreateTMCChart(metricOptions);
             client.Close();
             if (metricOptions.ShowDataTable)
             {
                 tmcvm.PopulateViewModel(tmcInfo.tmcData, metricOptions.SelectedBinSize);
             }
             tmcvm.ImageLocations = tmcInfo.ImageLocations;
         }
         catch (Exception ex)
         {
             client.Close();
             return(Content("<h1>" + ex.Message + "</h1>"));
         }
     }
     return(PartialView("GetTMCMetric", tmcvm));
 }
コード例 #2
0
 public ActionResult TMCOptions(int id)
 {
     MOE.Common.Business.WCFServiceLibrary.TMCOptions tMCOptions =
         new MOE.Common.Business.WCFServiceLibrary.TMCOptions();
     tMCOptions.SetDefaults();
     return(PartialView("TMCOptions", tMCOptions));
 }
コード例 #3
0
        public ActionResult MetricOptions(int id)
        {
            switch (id)
            {
            case 1:
                MOE.Common.Business.WCFServiceLibrary.PhaseTerminationOptions phaseTerminationOptions =
                    new MOE.Common.Business.WCFServiceLibrary.PhaseTerminationOptions();
                phaseTerminationOptions.SetDefaults();
                return(PartialView("PhaseTerminationOptions", phaseTerminationOptions));

            case 2:
                MOE.Common.Business.WCFServiceLibrary.SplitMonitorOptions SplitMonitorOptions =
                    new MOE.Common.Business.WCFServiceLibrary.SplitMonitorOptions();
                return(PartialView("SplitMonitorOptions", SplitMonitorOptions));

            case 3:
                MOE.Common.Business.WCFServiceLibrary.PedDelayOptions pedDelayOptions =
                    new MOE.Common.Business.WCFServiceLibrary.PedDelayOptions();
                pedDelayOptions.SetDefaults();
                return(PartialView("PedDelayOptions", pedDelayOptions));

            case 5:
                MOE.Common.Business.WCFServiceLibrary.TMCOptions tMCOptions =
                    new MOE.Common.Business.WCFServiceLibrary.TMCOptions();
                tMCOptions.SetDefaults();
                return(PartialView("TMCOptions", tMCOptions));

            case 4:
                MOE.Common.Business.WCFServiceLibrary.MetricOptions preemptOptions =
                    new MOE.Common.Business.WCFServiceLibrary.MetricOptions();
                preemptOptions.YAxisMax  = 3;
                preemptOptions.Y2AxisMax = 10;
                return(PartialView("PreemptOptions", preemptOptions));

            case 6:
                MOE.Common.Business.WCFServiceLibrary.PCDOptions pcdOptions =
                    new MOE.Common.Business.WCFServiceLibrary.PCDOptions();
                return(PartialView("PCDOptions", pcdOptions));

            case 7:
                MOE.Common.Business.WCFServiceLibrary.ApproachVolumeOptions approachVolumeOptions =
                    new MOE.Common.Business.WCFServiceLibrary.ApproachVolumeOptions();
                return(PartialView("ApproachVolumeOptions", approachVolumeOptions));

            case 8:
                MOE.Common.Business.WCFServiceLibrary.ApproachDelayOptions approachDelayOptions =
                    new MOE.Common.Business.WCFServiceLibrary.ApproachDelayOptions();
                approachDelayOptions.SetDefaults();
                return(PartialView("ApproachDelayOptions", approachDelayOptions));

            case 9:
                MOE.Common.Business.WCFServiceLibrary.AoROptions aoROptions =
                    new MOE.Common.Business.WCFServiceLibrary.AoROptions();
                aoROptions.SetDefaults();
                return(PartialView("AoROptions", aoROptions));

            case 10:
                MOE.Common.Business.WCFServiceLibrary.ApproachSpeedOptions approachSpeedOptions =
                    new MOE.Common.Business.WCFServiceLibrary.ApproachSpeedOptions();
                approachSpeedOptions.SetDefaults();
                return(PartialView("ApproachSpeedOptions", approachSpeedOptions));

            case 11:
                MOE.Common.Business.WCFServiceLibrary.YellowAndRedOptions yellowAndRedOptions =
                    new MOE.Common.Business.WCFServiceLibrary.YellowAndRedOptions();
                yellowAndRedOptions.SetDefaults();
                return(PartialView("YellowAndRedOptions", yellowAndRedOptions));

            case 12:
            default:
                MOE.Common.Business.WCFServiceLibrary.SplitFailOptions splitFailOptions =
                    new MOE.Common.Business.WCFServiceLibrary.SplitFailOptions();
                splitFailOptions.SetDefaults();
                return(PartialView("SplitFailOptions", splitFailOptions));
            }
        }