Exemplo n.º 1
0
 public ActionResult DisplayDef(StatComplexFieldRepository repository)
 {
     return View(new StatFieldViewModel(repository.FieldList[0])
     {
         FieldLength = 8,
         ColorThemeDescription = "喷漆"
     });
 }
Exemplo n.º 2
0
 public ActionResult DisplayDef(StatFieldViewModel viewModel,
     StatComplexFieldRepository repository)
 {
     for (int i = 0; i < repository.FieldList.Count; i++)
     {
         if (i == (int)viewModel.FieldName.GetStatRuIndex()
             + StatValueChoiceQueries.Choices.Count()
             || i == (int)viewModel.FieldName.GetStatValueIndex()
             || repository.FieldList[i].IntervalList.Count == 0)
         {
             repository.FieldList[i].AutoGenerateIntervals(
                 viewModel.FieldLength, viewModel.ColorThemeDescription.GetColorThemeIndex());
         }
     }
     GenerateValuesMrsService service = new GenerateValuesMrsService(RutraceStatContainer.MrsStats);
     return View(new StatFieldViewModel(repository[viewModel.FieldName],
         service.GenerateValues(viewModel.FieldName))
     {
         FieldLength = viewModel.FieldLength,
         ColorThemeDescription = viewModel.ColorThemeDescription
     });
 }
Exemplo n.º 3
0
        public object BindModel(ControllerContext controllerContext,
            ModelBindingContext bindingContext)
        {
            StatComplexFieldRepository repository
                = (StatComplexFieldRepository)controllerContext.HttpContext.Session[sessionKey];

            if (repository == null)
            {
                repository = new StatComplexFieldRepository();
                controllerContext.HttpContext.Session[sessionKey] = repository;
            }
            // return the cart
            return repository;
        }
        public JsonResult ImportCellsWithRange(EvaluationInfrastructure infrastructure,
            StatComplexFieldRepository repository,
            string fieldName, double southWestLon, double southWestLat,
            double northEastLon, double northEastLat)
        {
            infrastructure.ImportCellList(
                eNodebRepository,
                cellRepository,
                new GeoPoint(southWestLon - GeoMath.BaiduLongtituteOffset, southWestLat - GeoMath.BaiduLattituteOffset),
                new GeoPoint(northEastLon - GeoMath.BaiduLongtituteOffset, northEastLat - GeoMath.BaiduLattituteOffset));
            if (string.IsNullOrEmpty(fieldName))
            {
                return Json(null, JsonRequestBehavior.AllowGet);
            }
            infrastructure.Region.CalculatePerformance(EvaluationSettings.TrafficLoad);
            StatValueField field = repository.FieldList[(int)fieldName.GetStatValueIndex()];

            List<MeasurePointInfo> infoList
                = infrastructure.Region.GetMeasureMergedList(field, EvaluationSettings.DistanceInMeter);
            return Json(infoList.Select(x =>
                new
                {
                    X1 = x.X1 + GeoMath.BaiduLongtituteOffset,
                    Y1 = x.Y1 + GeoMath.BaiduLattituteOffset,
                    X2 = x.X2 + GeoMath.BaiduLongtituteOffset,
                    Y2 = x.Y2 + GeoMath.BaiduLattituteOffset,
                    C = x.ColorString
                }).ToArray(),
                JsonRequestBehavior.AllowGet);
        }
Exemplo n.º 5
0
        public ActionResult ExportSectors(StatComplexFieldRepository repository)
        {
            if (RutraceStatContainer.MrsStats == null || RutraceStatContainer.MrsStats.Count == 0)
            {
                TempData["warning"] = "小区统计数据为空!请先导入并统计数据。";
                return RedirectToAction("Import");
            }

            for (int i = 0; i < StatRuChoiceQueries.Choices.Count(); i++)
            {
                StatValueField field = repository.FieldList[i + StatRuChoiceQueries.Choices.Count()];
                if (field.IntervalList.Count == 0)
                {
                    TempData["warning"] = "显示区间:" + StatRuChoiceQueries.Choices.ElementAt(0)
                        + "设置为空!请先设置区间。";
                    return RedirectToAction("DisplayDef");
                }
            }

            return View(new StatFieldsSelectionViewModel
            {
                RuFieldName = StatRuChoiceQueries.Choices.ElementAt(0),
                ValueFieldName = StatValueChoiceQueries.Choices.ElementAt(0),
                Longtitute = outdoorCellList.Where(x => x.Height > 1).Select(x => x.Longtitute).Distinct().Average(),
                Lattitute = outdoorCellList.Where(x => x.Height > 1).Select(x => x.Lattitute).Distinct().Average()
            });
        }
Exemplo n.º 6
0
 public JsonResult GetStatValueField(StatComplexFieldRepository repository,
     string fieldName)
 {
     StatValueField field = repository.FieldList[(int)fieldName.GetStatValueIndex()];
     return Json(field.IntervalList.Select(x => new
     {
         L = x.IntervalLowLevel,
         H = x.IntervalUpLevel,
         C = x.Color.ColorStringForHtml,
         K = x.Color.ColorStringForKml
     }).ToArray(),
     JsonRequestBehavior.AllowGet);
 }
Exemplo n.º 7
0
 public JsonResult GetStatSectors(StatComplexFieldRepository repository, string fieldName)
 {
     List<SectorTriangle> info = repository.GenerateSectors(RutraceStatContainer.MrsStats,
         outdoorCellList, fieldName);
     return Json(info, JsonRequestBehavior.AllowGet);
 }
Exemplo n.º 8
0
 public JsonResult GetStatField(StatComplexFieldRepository repository,
     string fieldName)
 {
     StatValueChoice valueChoice = fieldName.GetStatValueIndex();
     StatRuChoice ruChoice = fieldName.GetStatRuIndex();
     int index = (valueChoice == StatValueChoice.Undefined) ?
         (int)ruChoice + StatValueChoiceQueries.Choices.Count() :
         (int)valueChoice;
     StatValueField field = repository.FieldList[index];
     return Json(field.IntervalList.Select(x => new
     {
         L = x.IntervalLowLevel,
         H = x.IntervalUpLevel,
         C = x.Color.ColorStringForHtml,
         K = x.Color.ColorStringForKml
     }).ToArray(),
     JsonRequestBehavior.AllowGet);
 }