public ActionResult GetApproachVolumeMetric(MOE.Common.Business.WCFServiceLibrary.ApproachVolumeOptions metricOptions) { MOE.Common.Models.Repositories.IApplicationEventRepository logRepository = MOE.Common.Models.Repositories.ApplicationEventRepositoryFactory.Create(); MetricInfo[] metrics = null; //metricOptions.MetricType = GetMetricType(metricOptions.MetricTypeID); //string[] result = new string[1] { "" }; if (ModelState.IsValid) { MetricGeneratorService.MetricGeneratorClient client = new MetricGeneratorService.MetricGeneratorClient(); try { client.Open(); metrics = client.CreateMetricWithDataTable((ApproachVolumeOptions)metricOptions); client.Close(); } catch (Exception ex) { client.Close(); return(Content("<h1>" + ex.Message + "</h1>")); } } return(PartialView("GetApproachVolumeMetric", metrics)); }
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)); }
public ActionResult GetPhaseTerminationMetric(MOE.Common.Business.WCFServiceLibrary.PhaseTerminationOptions metricOptions) { metricOptions.MetricType = GetMetricType(metricOptions.MetricTypeID); string[] result = new string[1] { "" }; if (ModelState.IsValid) { MetricGeneratorService.MetricGeneratorClient client = new MetricGeneratorService.MetricGeneratorClient(); try { client.Open(); result = client.CreateMetric(metricOptions); client.Close(); } catch (Exception ex) { client.Close(); return(Content("<h1>" + ex.Message + "</h1>")); } } return(PartialView("MetricResult", result)); }
private ActionResult GetChartFromService(SignalAggregationMetricOptions options) { Models.MetricAndXmlResultViewModel result = new Models.MetricAndXmlResultViewModel(); MetricGeneratorService.MetricGeneratorClient client = new MetricGeneratorService.MetricGeneratorClient(); try { client.Open(); var resultPaths = client.GetChartAndXmlFileLocations(options); client.Close(); result.ChartPaths = resultPaths.ToList(); return(PartialView("~/Views/AggregateDataExport/MetricResult.cshtml", result)); } catch (Exception ex) { client.Close(); return(Content("<h1>" + ex.Message + "</h1>")); } }
public ActionResult GetPreemptMetric(MOE.Common.Business.WCFServiceLibrary.MetricOptions metricOptions) { string[] result = new string[1] { "" }; if (ModelState.IsValid) { string[] tempResult1; string[] tempResult2; string[] tempResult3; MOE.Common.Business.WCFServiceLibrary.PreemptServiceRequestOptions requestOptions = new MOE.Common.Business.WCFServiceLibrary.PreemptServiceRequestOptions(metricOptions.SignalID, metricOptions.StartDate, metricOptions.EndDate); requestOptions.MetricTypeID = 14; MOE.Common.Business.WCFServiceLibrary.PreemptServiceMetricOptions serviceOptions = new MOE.Common.Business.WCFServiceLibrary.PreemptServiceMetricOptions(metricOptions.SignalID, metricOptions.StartDate, metricOptions.EndDate, metricOptions.YAxisMax ?? 0); serviceOptions.MetricTypeID = 15; MOE.Common.Business.WCFServiceLibrary.PreemptDetailOptions detailOptions = new MOE.Common.Business.WCFServiceLibrary.PreemptDetailOptions(metricOptions.SignalID, metricOptions.StartDate, metricOptions.EndDate); detailOptions.MetricTypeID = metricOptions.MetricTypeID; MetricGeneratorService.MetricGeneratorClient client = new MetricGeneratorService.MetricGeneratorClient(); client.Open(); tempResult1 = client.CreateMetric(requestOptions); tempResult2 = client.CreateMetric(serviceOptions); tempResult3 = client.CreateMetric(detailOptions); client.Close(); List <string> finalList = new List <string>(); finalList.AddRange(tempResult1); finalList.AddRange(tempResult2); finalList.AddRange(tempResult3); result = finalList.ToArray(); } return(PartialView("MetricResult", result)); }