public void TestEvaluationInfrastructure_CellConstructor()
 {
     infrastructure = new EvaluationInfrastructure();
     infrastructure.ImportCellList(cellList);
     Assert.IsNotNull(infrastructure);
     Assert.IsNotNull(infrastructure.MeasurePointList);
     Assert.IsNotNull(infrastructure.Region);
     Assert.AreEqual(infrastructure.Region.Length, 4956);
     Assert.AreEqual(infrastructure.MeasurePointList.Count(), 4956);
     Assert.IsNotNull(infrastructure.Region[5].Result);
     Assert.AreEqual(infrastructure.Region[5].Result.NominalSinr, double.MinValue);
     Assert.AreEqual(infrastructure.Region[5].CellRepository.CellList.Count, 6);
     Assert.AreEqual(infrastructure.Region[5].CellRepository.CellList[0].Cell.Cell.Longtitute, 113.001);
     Assert.AreEqual(infrastructure.Region.DegreeInterval, 0.00045, eps);
 }
        public void TestEvaluationInfrastructure_CellConstructor_CalculatePerformance()
        {
            infrastructure = new EvaluationInfrastructure();
            infrastructure.ImportCellList(cellList);
            infrastructure.Region.CalculatePerformance(0.1);
            Assert.IsTrue(infrastructure.Region[5].Result.NominalSinr > 1);
            Assert.IsTrue(infrastructure.Region[7].Result.NominalSinr > 1);
            IEnumerable<MeasurePoint> orderedList = infrastructure.MeasurePointList.OrderByDescending(
                x => x.Result.NominalSinr);
            MeasurePoint point = orderedList.ElementAt(0);
            Assert.IsTrue(point.Result.NominalSinr > 30);
            Assert.IsTrue(point.Result.StrongestCell.ReceivedRsrp > -65);
            Assert.IsTrue(point.Result.StrongestCell.DistanceInMeter < 30);
            Assert.AreEqual(point.CellRepository.CellList.Count, 6);
            Assert.AreEqual(point.CellRepository.CellList[0].ReceivedRsrp, point.Result.StrongestCell.ReceivedRsrp, eps);

            Assert.AreEqual(point.CellRepository.CellList[0].PciModx, 2);
        }
        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);
        }