public void TestCoverageStatList_Hugeland() { HugelandDescriptionInitialize(); testInput = HugelandRecordExample; coverageStatList = CsvContext.ReadString<HugelandRecord>(testInput, fileDescription_namesUs).Select(x => { CoverageStat stat = new CoverageStat(); stat.Import(x); return stat; }).ToList(); Assert.AreEqual(coverageStatList.Count, 19); Assert.AreEqual(coverageStatList[0].Longtitute, 113.13548); Assert.AreEqual(coverageStatList[0].Lattitute, 23.07062); Assert.AreEqual(coverageStatList[0].Rsrp, -93); Assert.AreEqual(coverageStatList[0].Sinr, 3.4); CoverageStatChart chart = new CoverageStatChart(); chart.Import(coverageStatList); Assert.AreEqual(chart.StatList.Count, 9); Assert.AreEqual(chart.StatList[0].Longtitute, 113.13548); Assert.AreEqual(chart.StatList[0].Lattitute, 23.07062); Assert.AreEqual(chart.StatList[0].Rsrp, -93); Assert.AreEqual(chart.StatList[1].Rsrp, -93.2, 1E-6); Assert.AreEqual(chart.StatList[2].Rsrp, -93.15); Assert.AreEqual(chart.StatList[3].Rsrp, -92.6); Assert.AreEqual(chart.StatList[4].Rsrp, -94.1); Assert.AreEqual(chart.StatList[5].Rsrp, -96.5); Assert.AreEqual(chart.StatList[6].Rsrp, -98.5); Assert.AreEqual(chart.StatList[7].Rsrp, -98.5); Assert.AreEqual(chart.StatList[8].Rsrp, -98.5); Assert.AreEqual(chart.StatList[0].Sinr, 3.4); Assert.AreEqual(chart.StatList[1].Sinr, 2.8); Assert.AreEqual(chart.StatList[2].Sinr, 2.55); }
public void TestCoverageStatList_Dingli() { DescriptionInitialize(); testInput = DingliRecordExample; coverageStatList = CsvContext.ReadString<LogRecord>(testInput, fileDescription_namesUs).Select(x => { CoverageStat stat = new CoverageStat(); stat.Import(x); return stat; }).ToList(); Assert.AreEqual(coverageStatList.Count, 74); Assert.AreEqual(coverageStatList[0].Longtitute, -9999); Assert.AreEqual(coverageStatList[0].Rsrp, -97.31); Assert.AreEqual(coverageStatList[0].Sinr, 14.3); CoverageStatChart chart = new CoverageStatChart(); chart.Import(coverageStatList); Assert.AreEqual(chart.StatList.Count, 7); Assert.AreEqual(chart.StatList[0].Longtitute, 113.0001); Assert.AreEqual(chart.StatList[0].Lattitute, 23.0002); Assert.AreEqual(chart.StatList[0].Rsrp, -97.31); Assert.AreEqual(chart.StatList[1].Rsrp, -97.25); Assert.AreEqual(chart.StatList[2].Rsrp, -97.25); Assert.AreEqual(chart.StatList[3].Rsrp, -97.25); Assert.AreEqual(chart.StatList[4].Rsrp, -97.25); Assert.AreEqual(chart.StatList[5].Rsrp, -97.25); Assert.AreEqual(chart.StatList[6].Rsrp, -97.25); Assert.AreEqual(chart.StatList[0].Sinr, 14.3); Assert.AreEqual(chart.StatList[1].Sinr, 13.4); Assert.AreEqual(chart.StatList[2].Sinr, 13.4); Assert.AreEqual(chart.StatList[3].Sinr, 13.4); Assert.AreEqual(chart.StatList[4].Sinr, 13.4); Assert.AreEqual(chart.StatList[5].Sinr, 13.4); Assert.AreEqual(chart.StatList[6].Sinr, 13.4); }
public void TestCoverageStatList_Hugeland() { HugelandDescriptionInitialize(); testInput = HugelandRecordExample; coverageStatList = CsvContext.ReadString <HugelandRecord>(testInput, fileDescription_namesUs).Select(x => { CoverageStat stat = new CoverageStat(); stat.Import(x); return(stat); }).ToList(); Assert.AreEqual(coverageStatList.Count, 19); Assert.AreEqual(coverageStatList[0].Longtitute, 113.13548); Assert.AreEqual(coverageStatList[0].Lattitute, 23.07062); Assert.AreEqual(coverageStatList[0].Rsrp, -93); Assert.AreEqual(coverageStatList[0].Sinr, 3.4); CoverageStatChart chart = new CoverageStatChart(); chart.Import(coverageStatList); Assert.AreEqual(chart.StatList.Count, 9); Assert.AreEqual(chart.StatList[0].Longtitute, 113.13548); Assert.AreEqual(chart.StatList[0].Lattitute, 23.07062); Assert.AreEqual(chart.StatList[0].Rsrp, -93); Assert.AreEqual(chart.StatList[1].Rsrp, -93.2, 1E-6); Assert.AreEqual(chart.StatList[2].Rsrp, -93.15); Assert.AreEqual(chart.StatList[3].Rsrp, -92.6); Assert.AreEqual(chart.StatList[4].Rsrp, -94.1); Assert.AreEqual(chart.StatList[5].Rsrp, -96.5); Assert.AreEqual(chart.StatList[6].Rsrp, -98.5); Assert.AreEqual(chart.StatList[7].Rsrp, -98.5); Assert.AreEqual(chart.StatList[8].Rsrp, -98.5); Assert.AreEqual(chart.StatList[0].Sinr, 3.4); Assert.AreEqual(chart.StatList[1].Sinr, 2.8); Assert.AreEqual(chart.StatList[2].Sinr, 2.55); }
public void TestCoverageStatList_Dingli() { DescriptionInitialize(); testInput = DingliRecordExample; coverageStatList = CsvContext.ReadString <LogRecord>(testInput, fileDescription_namesUs).Select(x => { CoverageStat stat = new CoverageStat(); stat.Import(x); return(stat); }).ToList(); Assert.AreEqual(coverageStatList.Count, 74); Assert.AreEqual(coverageStatList[0].Longtitute, -9999); Assert.AreEqual(coverageStatList[0].Rsrp, -97.31); Assert.AreEqual(coverageStatList[0].Sinr, 14.3); CoverageStatChart chart = new CoverageStatChart(); chart.Import(coverageStatList); Assert.AreEqual(chart.StatList.Count, 7); Assert.AreEqual(chart.StatList[0].Longtitute, 113.0001); Assert.AreEqual(chart.StatList[0].Lattitute, 23.0002); Assert.AreEqual(chart.StatList[0].Rsrp, -97.31); Assert.AreEqual(chart.StatList[1].Rsrp, -97.25); Assert.AreEqual(chart.StatList[2].Rsrp, -97.25); Assert.AreEqual(chart.StatList[3].Rsrp, -97.25); Assert.AreEqual(chart.StatList[4].Rsrp, -97.25); Assert.AreEqual(chart.StatList[5].Rsrp, -97.25); Assert.AreEqual(chart.StatList[6].Rsrp, -97.25); Assert.AreEqual(chart.StatList[0].Sinr, 14.3); Assert.AreEqual(chart.StatList[1].Sinr, 13.4); Assert.AreEqual(chart.StatList[2].Sinr, 13.4); Assert.AreEqual(chart.StatList[3].Sinr, 13.4); Assert.AreEqual(chart.StatList[4].Sinr, 13.4); Assert.AreEqual(chart.StatList[5].Sinr, 13.4); Assert.AreEqual(chart.StatList[6].Sinr, 13.4); }
public ActionResult CoverageAnalyze(HttpPostedFileBase[] fileUpload, CoverageStatChart chart) { List <CoverageStat> coverageStatList = new List <CoverageStat>(); if (fileUpload[0] != null) { foreach (HttpPostedFileBase file in fileUpload) { using (HttpFileImporter importer = new HttpFileImporter(file)) { if (!importer.Success) { if (TempData["warning"] == null) { TempData["warning"] = "请选择合适的路测数据导入!读取以下文件失败:" + importer.FilePath; } else { TempData["warning"] += "; " + importer.FilePath; } } else { string extension = Path.GetExtension(importer.FileName); if (extension != null) { string fileExt = extension.ToLower(); coverageStatList.AddRange( (fileExt == ".txt") ? CsvContext.Read <LogRecord>( importer.Reader, CsvFileDescription.TabDescription).Select(x => { CoverageStat stat = new CoverageStat(); stat.Import(x); return(stat); }).ToList() : CsvContext.Read <HugelandRecord>( importer.Reader, CsvFileDescription.CommaDescription).Select(x => { CoverageStat stat = new CoverageStat(); stat.Import(x); return(stat); })); } chart.Import(coverageStatList); if (TempData["warning"] == null) { TempData["success"] = "导入路测数据成功!"; } } } } } ViewBag.Title = "路测覆盖指标分析"; TempData["StatLength"] = chart.StatList.Count; return(View("CoverageImport")); }
public ActionResult CoverageAnalyze(HttpPostedFileBase[] fileUpload, CoverageStatChart chart) { List<CoverageStat> coverageStatList = new List<CoverageStat>(); if (fileUpload[0] != null) { foreach (HttpPostedFileBase file in fileUpload) { using (HttpFileImporter importer = new HttpFileImporter(file)) { if (!importer.Success) { if (TempData["warning"] == null) { TempData["warning"] = "请选择合适的路测数据导入!读取以下文件失败:" + importer.FilePath; } else { TempData["warning"] += "; " + importer.FilePath; } } else { string extension = Path.GetExtension(importer.FileName); if (extension != null) { string fileExt = extension.ToLower(); coverageStatList.AddRange( (fileExt == ".txt") ? CsvContext.Read<LogRecord>( importer.Reader, CsvFileDescription.TabDescription).Select(x => { CoverageStat stat = new CoverageStat(); stat.Import(x); return stat; }).ToList() : CsvContext.Read<HugelandRecord>( importer.Reader, CsvFileDescription.CommaDescription).Select(x => { CoverageStat stat = new CoverageStat(); stat.Import(x); return stat; })); } chart.Import(coverageStatList); if (TempData["warning"] == null) { TempData["success"] = "导入路测数据成功!"; } } } } } ViewBag.Title = "路测覆盖指标分析"; TempData["StatLength"] = chart.StatList.Count; return View("CoverageImport"); }