public void TestStatValueGetColor_InterferenceSource(double ratio, int victimCells,
                                                             string expectedColor)
        {
            _field.FieldName = "干扰源分析";
            _service         = new RuInterferenceSourceService(_stat);
            _field.AutoGenerateIntervals(8);
            AsserOriginalColors();
            _stat.InterferenceRatio = ratio;
            _stat.VictimCells       = victimCells;
            string colorString = _service.GetColor(_field);

            Assert.AreEqual(colorString, expectedColor);
        }
예제 #2
0
        public JsonResult CoverageIntervalPercentage(string fieldName, CoverageStatChart chart)
        {
            StatValueField field = new StatValueField {
                FieldName = fieldName
            };

            field.AutoGenerateIntervals(8);
            IEnumerable <double> values = (fieldName == "信号RSRP") ?
                                          chart.StatList.Select(x => x.Rsrp) : chart.StatList.Select(x => x.Sinr);
            Dictionary <string, double> result = field.GetPercentageStat(values);

            return(Json(result.Select(x => new { N = x.Key, V = 100 * x.Value }), JsonRequestBehavior.AllowGet));
        }