Esempio n. 1
0
        public StatValueField GenerateDefaultField(string fieldName)
        {
            StatValueField field = FieldList[(int)fieldName.GetStatValueIndex()];

            if (field.IntervalList.Count == 0)
            {
                field.AutoGenerateIntervals(8);
            }
            return(field);
        }
Esempio n. 2
0
        public void GenerateKmlFile(string kmlFileName,
            List<MeasurePointInfo> measurePointList, StatValueField field)
        {
            TextReader reader = new StreamReader(Framework.KmlFileName);
            XmlDocument doc = GenerateKmlDoc(measurePointList, field, reader);

            XmlTextWriter tr = new XmlTextWriter(kmlFileName, null);
            tr.Formatting = Formatting.Indented;
            doc.WriteContentTo(tr);
            tr.Close();
        }
Esempio n. 3
0
 public StatFieldViewModel(StatValueField field, IEnumerable<double> values)
     : this(field)
 {
     IntervalSettingList = new List<StatValueIntervalSetting>();
     for (int i = 0; i < IntervalList.Count; i++)
     {
         IntervalSettingList.Add(new StatValueIntervalSetting
         {
             IntervalLowLevel = IntervalList[i].IntervalLowLevel,
             IntervalUpLevel = IntervalList[i].IntervalUpLevel,
             SuggestUpLevel = IntervalList[i].IntervalUpLevel,
             RecordsCount = values.Count(x => x >= IntervalList[i].IntervalLowLevel
                                              && x < IntervalList[i].IntervalUpLevel)
         });
     }
 }
Esempio n. 4
0
        public MeasurePointInfo(MeasurePoint point, StatValueField field, double degreeSpan) : this()
        {
            X1 = point.Longtitute - degreeSpan / 2;
            X2 = point.Longtitute + degreeSpan / 2;
            Y1 = point.Lattitute - degreeSpan / 2;
            Y2 = point.Lattitute + degreeSpan / 2;
            double value;

            switch (field.FieldName)
            {
            case "同模干扰电平":
                value = point.Result.SameModInterferenceLevel;
                break;

            case "不同模干扰电平":
                value = point.Result.DifferentModInterferenceLevel;
                break;

            case "总干扰电平":
                value = point.Result.TotalInterferencePower;
                break;

            case "信号RSRP":
                value = point.Result.StrongestCell.ReceivedRsrp;
                break;

            default:
                value = point.Result.NominalSinr;
                break;
            }
            if (field.IntervalList.Count > 0)
            {
                StatValueInterval interval = field.IntervalList.FirstOrDefault(
                    x => x.IntervalLowLevel < value && value < x.IntervalUpLevel);
                if (interval != null)
                {
                    interval.Color.ColorA = 128;
                    ColorString           = interval.Color.ColorStringForHtml;
                    ColorStringForKml     = interval.Color.ColorStringForKml;
                }
                else
                {
                    ColorString       = "ffffff";
                    ColorStringForKml = "80FFFFFF";
                }
            }
        }
Esempio n. 5
0
        public static XmlDocument GenerateKmlDoc(List<MeasurePointInfo> measurePointList, 
            StatValueField field, TextReader reader)
        {
            XmlDocument doc = new XmlDocument();
            doc.Load(reader);
            doc.InitializeKmlDocument(field.IntervalList.Select(x => x.Color.ColorStringForKml));

            for (int i = 0; i < measurePointList.Count(); i++)
            {
                PlacemarkKmlElement placemarkKmlElement = new PlacemarkKmlElement(doc, "测试点")
                {
                    StyleUrl = "Color-" + measurePointList[i].ColorStringForKml,
                    CoordinatesInfo = measurePointList[i].CoordinatesInfo
                };
                XmlElement placemarkElement = placemarkKmlElement.CreateElement();
                doc.AddPlacemarkElement(placemarkElement);
            }
            return doc;
        }
 public void TestInitialize()
 {
     _fieldElement = new XElement("Field", new XAttribute("ID", "myFieldName"));
     _fieldElement.Add(new XElement("Interval",
             new XElement("LowLevel", "11"),
             new XElement("UpLevel", "15"),
             new XElement("A", "98"),
             new XElement("B", "114"),
             new XElement("R", "198"),
             new XElement("G", "221")));
     _fieldElement.Add(new XElement("Interval",
             new XElement("LowLevel", "15"),
             new XElement("UpLevel", "17"),
             new XElement("A", "6"),
             new XElement("B", "14"),
             new XElement("R", "108"),
             new XElement("G", "171")));
     _field = new StatValueField(_fieldElement);
 }
Esempio n. 7
0
 public void TestInitialize()
 {
     _statValueField = new StatValueField
     {
         IntervalList = new List<StatValueInterval>
         {
             new StatValueInterval
             {
                 IntervalLowLevel = 0,
                 IntervalUpLevel = 1
             },
             new StatValueInterval
             {
                 IntervalLowLevel = 1,
                 IntervalUpLevel = 2
             },
             new StatValueInterval
             {
                 IntervalLowLevel = 2,
                 IntervalUpLevel = 3
             }
         }
     };
 }
Esempio n. 8
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);
 }
Esempio n. 9
0
 public StatFieldViewModel(StatValueField field)
 {
     FieldName = field.FieldName;
     IntervalList = field.IntervalList;
 }
Esempio n. 10
0
 public void TestInitialize()
 {
     _stat = new RuInterferenceStat();
     _field = new StatValueField();
 }