public void Test_HuaweiFile_Merge() { var testDirectory = AppDomain.CurrentDomain.BaseDirectory; var csvFilesDirectory = Path.Combine(testDirectory, "CsvFiles"); var path = Path.Combine(csvFilesDirectory, "NeighborCellHw.csv"); var reader = new StreamReader(path); var infos = NeighborCellHwCsv.ReadNeighborCellHwCsvs(reader); Assert.AreEqual(infos.Count, 7); }
public void UploadHwNeighbors(StreamReader reader) { var groupInfos = NeighborCellHwCsv.ReadNeighborCellHwCsvs(reader); foreach (var info in groupInfos) { var cell = NearestPciCell.ConstructCell(info, _cellRepository); if (cell.Pci >= 0) { NearestCells.Push(cell); } } }
public static NearestPciCell ConstructCell(NeighborCellHwCsv info, ICellRepository cellRepository) { var fields = info.CellRelation.GetSplittedFields(); var cellId = fields[13].ConvertToInt(0); var sectorId = fields[5].ConvertToByte(0); var neighborCellId = fields[11].ConvertToInt(0); var neighborSectorId = fields[3].ConvertToByte(0); var neiborCell = neighborCellId > 10000 ? cellRepository.GetBySectorId(neighborCellId, neighborSectorId) : null; return(new NearestPciCell { CellId = cellId, SectorId = (neighborSectorId > 30 && sectorId < 30) ? (byte)(sectorId + 48) : sectorId, NearestCellId = neighborCellId, NearestSectorId = neighborSectorId, Pci = neiborCell?.Pci ?? -1, TotalTimes = info.TotalTimes }); }