コード例 #1
0
 public void TestInitialize()
 {
     Initialize();
     Repository = new StatValueFieldRepository
     {
         FieldList = statValueFieldList
     };
 }
コード例 #2
0
 public void TestStatValueFieldRepository_InitializeByFieldList()
 {
     Repository = new StatValueFieldRepository
     {
         FieldList = statValueFieldList
     };
     Assert.AreEqual(Repository.FieldDoc.ToString().Replace("\r\n", "\n"), resultString.Replace("\r\n", "\n"));
 }
コード例 #3
0
 public void TestStatValueFieldRepository_DefaultConstruction()
 {
     Repository = new StatValueFieldRepository();
     Assert.IsNotNull(Repository);
     Assert.IsNotNull(Repository.FieldList);
     Assert.AreEqual(Repository.FieldList.Count, 5);
     Assert.AreEqual(Repository.FieldList[0].FieldName, "同模干扰电平");
     Assert.IsNotNull(Repository.FieldList[1].IntervalList);
     Assert.AreEqual(Repository.FieldList[2].IntervalList.Count, 0);
     Assert.AreEqual(Repository.FieldList[4].FieldName, "信号RSRP");
 }
コード例 #4
0
        public void TestStatValueFieldRepository_InitializeByFieldDoc()
        {
            Stream stream = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(resultString));
            XDocument document = XDocument.Load(
                new StreamReader(stream, System.Text.Encoding.UTF8));
            Assert.AreEqual(document.ToString().Replace("\r\n", "\n"), resultString.Replace("\r\n", "\n"));
            Repository = new StatValueFieldRepository
            {
                FieldDoc = document
            };
            Assert.IsNotNull(Repository.FieldList);

            Assert.AreEqual(Repository.FieldList.Count, 2);
            Assert.AreEqual(Repository.FieldList[0].FieldName, "field1");
            Assert.AreEqual(Repository.FieldList[1].IntervalList.Count, 2);
            Assert.AreEqual(Repository.FieldList[0].IntervalList[2].IntervalLowLevel, 2);
            Assert.AreEqual(Repository.FieldList[1].IntervalList[0].Color.ColorA, 155);
        }
コード例 #5
0
        public ActionResult ExportPoints(string fieldName,
            EvaluationInfrastructure infrastructure,
            StatValueFieldRepository repository)
        {
            if (infrastructure.Region == null || infrastructure.Region.Length == 0
                || infrastructure.CellList.Count == 0)
            {
                TempData["warning"] = "仿真区域设置为空!请先设置仿真区域。";
                return RedirectToAction("RegionDef");
            }
            StatValueField field = repository.FieldList[(int)fieldName.GetStatValueIndex()];
            if (field.IntervalList.Count == 0)
            {
                TempData["warning"] = "显示区间设置为空!请先设置区间。";
                return RedirectToAction("PointsAnalysis");
            }

            TempData["centerX"] = infrastructure.CellList.Average(x=>x.BaiduLongtitute);
            TempData["centerY"] = infrastructure.CellList.Average(x=>x.BaiduLattitute);
            return View(field);
        }
コード例 #6
0
        public ActionResult ExportKml(string fieldName,
            EvaluationInfrastructure infrastructure,
            StatValueFieldRepository repository)
        {
            StatValueField field = repository.FieldList[(int)fieldName.GetStatValueIndex()];
            if (field.IntervalList.Count == 0)
            {
                TempData["warning"] = "显示区间设置为空!请先设置区间。";
                return RedirectToAction("PointsAnalysis");
            }

            GoogleKml kml = new GoogleKml("framework.xml");
            string absoluFilePath
                = Path.Combine(AppDomain.CurrentDomain.BaseDirectory + "uploads\\",
                "Kmlresults-" + field.FieldName + DateTime.Today.ToString("yyyyMMdd"));
            kml.GenerateKmlFile(absoluFilePath,
                infrastructure.Region.GetMeasureInfoList(field, EvaluationSettings.DistanceInMeter), field);
            return File(new FileStream(absoluFilePath, FileMode.Open),
                "application/octet-stream", Server.UrlEncode(
                "Kmlresults-" + field.FieldName + DateTime.Today.ToString("yyyyMMdd") + ".kml"));
        }
コード例 #7
0
ファイル: EvaluationBinder.cs プロジェクト: ouyh18/LteTools
        public object BindModel(ControllerContext controllerContext,
            ModelBindingContext bindingContext)
        {
            StatValueFieldRepository repository
                = (StatValueFieldRepository)controllerContext.HttpContext.Session[sessionKey];

            if (repository == null)
            {
                repository = new StatValueFieldRepository();
                controllerContext.HttpContext.Session[sessionKey] = repository;
            }
            // return the cart
            return repository;
        }
コード例 #8
0
ファイル: CoverageController.cs プロジェクト: ouyh18/LteTools
 public JsonResult GetStatValueField(StatValueFieldRepository repository,
     string fieldName)
 {
     StatValueField field = repository.GenerateDefaultField(fieldName);
     return Json(field.IntervalList.Select(x => new
     {
         L = x.IntervalLowLevel,
         H = x.IntervalUpLevel,
         C = x.Color.ColorStringForHtml,
         K = x.Color.ColorStringForKml
     }).ToArray(),
     JsonRequestBehavior.AllowGet);
 }
コード例 #9
0
ファイル: CoverageController.cs プロジェクト: ouyh18/LteTools
 public JsonResult GetCoveragePoints(string fieldName,
     StatValueFieldRepository repository, CoverageStatChart chart)
 {
     StatValueField field = repository.GenerateDefaultField(fieldName);
     return Json(chart.StatList.Select(x => new
     {
         X = x.Longtitute + GeoMath.BaiduLongtituteOffset,
         Y = x.Lattitute + GeoMath.BaiduLattituteOffset,
         C = field.GetColor(fieldName == "信号RSRP" ? x.Rsrp : x.Sinr, "FFFFFF")
     }), JsonRequestBehavior.AllowGet);
 }
コード例 #10
0
ファイル: CoverageController.cs プロジェクト: ouyh18/LteTools
 public ActionResult ExportPoints(string fieldName, StatValueFieldRepository repository,
     CoverageStatChart chart)
 {
     if (chart.StatList.Count == 0)
     {
         TempData["warning"] = "覆盖数据为空,请先导入数据分析。";
         return RedirectToAction("CoverageImport");
     }
     StatValueField field = repository.GenerateDefaultField(fieldName);
     TempData["centerX"] = chart.StatList.Average(x=>x.BaiduLongtitute);
     TempData["centerY"] = chart.StatList.Average(x=>x.BaiduLattitute);
     return View(field);
 }
コード例 #11
0
 public ActionResult PointsAnalysis(StatFieldViewModel viewModel,
     StatValueFieldRepository repository)
 {
     for (int i = 0; i < repository.FieldList.Count; i++)
     {
         if (i == (int)viewModel.FieldName.GetStatValueIndex()
             || repository.FieldList[i].IntervalList.Count == 0)
         {
             repository.FieldList[i].AutoGenerateIntervals(
                 viewModel.FieldLength, viewModel.ColorThemeDescription.GetColorThemeIndex());
         }
     }
     return View(new StatFieldViewModel(repository.FieldList[(int)viewModel.FieldName.GetStatValueIndex()])
     {
         FieldLength = viewModel.FieldLength,
         ColorThemeDescription = viewModel.ColorThemeDescription
     });
 }
コード例 #12
0
 public ActionResult PointsAnalysis(StatValueFieldRepository repository)
 {
     return View(new StatFieldViewModel(repository.FieldList[0])
     {
         FieldLength = 4,
         ColorThemeDescription = "春"
     });
 }
コード例 #13
0
 public JsonResult GetPoints(string fieldName,
     EvaluationInfrastructure infrastructure,
     StatValueFieldRepository repository)
 {
     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);
 }