Example #1
0
 public void TestMroRecordSet(string contents, int recordCounts, int eNodebId, string recordDate,
                              byte[] mainSectorId, byte[] mainRsrp, short[] mainFrequency, byte[] mainTa, int[] nbCounts,
                              short[] nbPci, byte[] nbRsrp, short[] nbFrequency)
 {
     using (StreamReader reader = contents.GetStreamReader())
     {
         MrRecordSet recordSet = new MroRecordSet(reader);
         Assert.AreEqual(recordSet.ENodebId, eNodebId);
         Assert.AreEqual(recordSet.RecordDate, DateTime.Parse(recordDate));
         Assert.AreEqual(recordSet.RecordList.Count, recordCounts);
         for (int i = 0, length = 0; i < recordCounts; length += nbCounts[i], i++)
         {
             Assert.AreEqual(recordSet.RecordList[i].RefCell.CellId, eNodebId);
             Assert.AreEqual(recordSet.RecordList[i].RefCell.SectorId, mainSectorId[i]);
             Assert.AreEqual(recordSet.RecordList[i].RefCell.Frequency, mainFrequency[i]);
             Assert.AreEqual(recordSet.RecordList[i].RefCell.Rsrp, mainRsrp[i]);
             Assert.AreEqual(recordSet.RecordList[i].RefCell.Ta, mainTa[i]);
             for (int j = 0; j < nbCounts[i]; j++)
             {
                 Assert.AreEqual(recordSet.RecordList[i].NbCells[j].Pci, nbPci[length + j]);
                 Assert.AreEqual(recordSet.RecordList[i].NbCells[j].Rsrp, nbRsrp[length + j]);
                 Assert.AreEqual(recordSet.RecordList[i].NbCells[j].Frequency, nbFrequency[length + j]);
             }
         }
     }
 }
Example #2
0
 public void TestEmptyMroRecordSet(string contents, string recordDate)
 {
     using (StreamReader reader = contents.GetStreamReader())
     {
         MrRecordSet recordSet = new MroRecordSet(reader);
         Assert.AreEqual(recordSet.ENodebId, 0);
         Assert.AreEqual(recordSet.RecordDate, DateTime.Parse(recordDate));
         Assert.AreEqual(recordSet.RecordList.Count, 0);
     }
 }
Example #3
0
 public void TestEmptyMroRecordSet(string contents, string recordDate)
 {
     using (StreamReader reader = contents.GetStreamReader())
     {
         MrRecordSet recordSet = new MroRecordSet(reader);
         Assert.AreEqual(recordSet.ENodebId, 0);
         Assert.AreEqual(recordSet.RecordDate, DateTime.Parse(recordDate));
         Assert.AreEqual(recordSet.RecordList.Count, 0);
     }
 }
 private Task ImportMroFiles(IEnumerable <string> files)
 {
     return(Task.Run(() =>
                     mroFilesImporter.Import(files, path =>
     {
         MroRecordSet recordSet;
         using (StreamReader reader = new StreamReader(path))
         {
             recordSet = new MroRecordSet(reader);
         }
         return recordSet;
     })));
 }
Example #5
0
 public static MrRecordSet Generate(this List<CdrRtdRecord> taRecordList,
     ILteNeighborCellRepository repository, IEnumerable<Cell> cells, string path)
 {
     NearestPciCellRepository neighborRepository = new NearestPciCellRepository(cells);
     MrRecordSet recordSet;
     using (StreamReader stream = new StreamReader(path))
     {
         recordSet = new MroRecordSet(stream);
         neighborRepository.AddNeighbors(repository, recordSet.ENodebId);
         taRecordList.Update(neighborRepository, recordSet);
     }
     return recordSet;
 }
Example #6
0
        public static MrRecordSet Generate(this List <CdrRtdRecord> taRecordList,
                                           ILteNeighborCellRepository repository, IEnumerable <Cell> cells, string path)
        {
            NearestPciCellRepository neighborRepository = new NearestPciCellRepository(cells);
            MrRecordSet recordSet;

            using (StreamReader stream = new StreamReader(path))
            {
                recordSet = new MroRecordSet(stream);
                neighborRepository.AddNeighbors(repository, recordSet.ENodebId);
                taRecordList.Update(neighborRepository, recordSet);
            }
            return(recordSet);
        }
Example #7
0
        public void Test_OneRef_OneNeighbor(int refCellId, byte refSectorId, int nbCellId, byte nbSectorId, short pci,
                                            short frequency, int resultCellId, byte resultSectorId)
        {
            MrRecordSet recordSet = new MroRecordSet
            {
                RecordDate = DateTime.Today,
                RecordList = new List <MrRecord>
                {
                    new MroRecord
                    {
                        RefCell = new MrReferenceCell
                        {
                            CellId   = refCellId,
                            SectorId = refSectorId
                        },
                        NbCells = new List <MrNeighborCell>
                        {
                            new MrNeighborCell
                            {
                                CellId    = 0,
                                SectorId  = 0,
                                Pci       = pci,
                                Frequency = frequency
                            }
                        }
                    }
                }
            };

            mockRepository.SetupGet(x => x.NearestPciCells).Returns(
                new List <NearestPciCell>
            {
                new NearestPciCell
                {
                    CellId          = refCellId,
                    SectorId        = refSectorId,
                    NearestCellId   = nbCellId,
                    NearestSectorId = nbSectorId,
                    Pci             = pci
                }
            });
            recordSet.ImportRecordSet(mockRepository.Object);
            Assert.AreEqual(recordSet.RecordList[0].NbCells[0].CellId, resultCellId);
            Assert.AreEqual(recordSet.RecordList[0].NbCells[0].SectorId, resultSectorId);
        }
Example #8
0
 public void Test_OneRef_OneNeighbor(int refCellId, byte refSectorId, int nbCellId, byte nbSectorId, short pci, 
     short frequency, int resultCellId, byte resultSectorId)
 {
     MrRecordSet recordSet = new MroRecordSet
     {
         RecordDate = DateTime.Today,
         RecordList = new List<MrRecord>
         {
             new MroRecord
             {
                 RefCell = new MrReferenceCell
                 {
                     CellId = refCellId,
                     SectorId = refSectorId
                 },
                 NbCells = new List<MrNeighborCell>
                 {
                     new MrNeighborCell
                     {
                         CellId = 0,
                         SectorId = 0,
                         Pci = pci,
                         Frequency = frequency
                     }
                 }
             }
         }
     };
     mockRepository.SetupGet(x => x.NearestPciCells).Returns(
         new List<NearestPciCell>
         {
             new NearestPciCell
             {
                 CellId = refCellId,
                 SectorId = refSectorId,
                 NearestCellId = nbCellId,
                 NearestSectorId = nbSectorId,
                 Pci = pci
             }
         });
     recordSet.ImportRecordSet(mockRepository.Object);
     Assert.AreEqual(recordSet.RecordList[0].NbCells[0].CellId,resultCellId);
     Assert.AreEqual(recordSet.RecordList[0].NbCells[0].SectorId,resultSectorId);
 }
Example #9
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);
     }
 }
 private Task ImportMroFiles(IEnumerable<string> files)
 {
     return Task.Run(() =>
         mroFilesImporter.Import(files, path =>
         {
             MroRecordSet recordSet;
             using (StreamReader reader = new StreamReader(path))
             {
                 recordSet = new MroRecordSet(reader);
             }
             return recordSet;
         }));
 }
Example #11
0
 public void TestMroRecordSet(string contents, int recordCounts, int eNodebId, string recordDate,
     byte[] mainSectorId, byte[] mainRsrp, short[] mainFrequency, byte[] mainTa, int[] nbCounts,
     short[] nbPci, byte[] nbRsrp, short[] nbFrequency)
 {
     using (StreamReader reader = contents.GetStreamReader())
     {
         MrRecordSet recordSet = new MroRecordSet(reader);
         Assert.AreEqual(recordSet.ENodebId, eNodebId);
         Assert.AreEqual(recordSet.RecordDate, DateTime.Parse(recordDate));
         Assert.AreEqual(recordSet.RecordList.Count, recordCounts);
         for (int i = 0, length = 0; i < recordCounts; length += nbCounts[i], i++)
         {
             Assert.AreEqual(recordSet.RecordList[i].RefCell.CellId, eNodebId);
             Assert.AreEqual(recordSet.RecordList[i].RefCell.SectorId, mainSectorId[i]);
             Assert.AreEqual(recordSet.RecordList[i].RefCell.Frequency, mainFrequency[i]);
             Assert.AreEqual(recordSet.RecordList[i].RefCell.Rsrp, mainRsrp[i]);
             Assert.AreEqual(recordSet.RecordList[i].RefCell.Ta, mainTa[i]);
             for (int j = 0; j < nbCounts[i]; j++)
             {
                 Assert.AreEqual(recordSet.RecordList[i].NbCells[j].Pci, nbPci[length + j]);
                 Assert.AreEqual(recordSet.RecordList[i].NbCells[j].Rsrp, nbRsrp[length + j]);
                 Assert.AreEqual(recordSet.RecordList[i].NbCells[j].Frequency, nbFrequency[length + j]);
             }
         }
     }
 }