示例#1
0
        public MroRecord(int eNodebId, XElement doc)
        {
            IEnumerable <string> values = doc.Descendants("v").Select(x => x.Value);
            int  cgi          = doc.Attribute("id").Value.ConvertToInt(0);
            bool firstElement = true;

            foreach (string value in values)
            {
                string[] contents = value.GetSplittedFields(' ');
                if (firstElement)
                {
                    RefCell = new MrReferenceCell
                    {
                        Frequency = contents[0].ConvertToShort(100),
                        CellId    = eNodebId,
                        SectorId  = cgi.GetLastByte(),
                        Rsrp      = contents[3] == "NIL" ? (byte)255 : contents[3].ConvertToByte(0),
                        Ta        = contents[5] == "NIL" ? (byte)255 : (contents[5].ConvertToShort(0) >> 4).GetLastByte()
                    };
                    firstElement = false;
                }
                if (contents[12] == "NIL")
                {
                    return;
                }
                NbCells.Add(new MrNeighborCell
                {
                    Frequency = contents[11].ConvertToShort(100),
                    Pci       = contents[12].ConvertToShort(0),
                    Rsrp      = contents[13].ConvertToByte(0)
                });
            }
        }
示例#2
0
        public MreRecord(int eNodebId, string line)
        {
            string[] contents = line.GetSplittedFields(' ');
            int      cgi      = contents[2].ConvertToInt(0);

            RefCell = new MrReferenceCell
            {
                Frequency = contents[0].ConvertToShort(100),
                CellId    = eNodebId,
                SectorId  = cgi.GetLastByte(),
                Rsrp      = contents[3].ConvertToByte(0)
            };
            for (int i = 0; i < 3; i++)
            {
                if (contents[5 + i * 4] == "NIL")
                {
                    break;
                }
                NbCells.Add(new MrNeighborCell
                {
                    Frequency = contents[5 + i * 4].ConvertToShort(100),
                    Pci       = contents[6 + i * 4].ConvertToShort(0),
                    Rsrp      = contents[7 + i * 4].ConvertToByte(0)
                });
            }
        }
示例#3
0
 public static void Import(this List <MroRsrpTa> statList, MroRecordSet recordSet)
 {
     foreach (MrRecord cell in recordSet.RecordList)
     {
         MrReferenceCell record = cell.RefCell;
         if (record == null || record.Ta == 255)
         {
             continue;
         }
         RsrpInterval interval = record.Rsrp.GetInterval();
         MroRsrpTa    stat     = statList.FirstOrDefault(x =>
                                                         x.RecordDate == recordSet.RecordDate && x.CellId == record.CellId && x.SectorId == record.SectorId &&
                                                         x.RsrpInterval == interval);
         if (stat == null)
         {
             statList.Add(new MroRsrpTa
             {
                 RecordDate   = recordSet.RecordDate,
                 CellId       = record.CellId,
                 SectorId     = record.SectorId,
                 RsrpInterval = interval
             });
         }
         else
         {
             stat.UpdateTa(record.Ta);
         }
     }
 }
示例#4
0
 private void AssertRefCell(MrReferenceCell cell, int eNodebId, byte sectorId, byte rsrp, short ta)
 {
     AssertRefCell(cell, eNodebId, sectorId, rsrp);
     Assert.AreEqual(cell.Ta, ta);
 }
示例#5
0
 private void AssertRefCell(MrReferenceCell cell, int eNodebId, byte sectorId, byte rsrp)
 {
     Assert.AreEqual(cell.CellId, eNodebId);
     Assert.AreEqual(cell.SectorId, sectorId);
     Assert.AreEqual(cell.Rsrp, rsrp);
 }