public void Test_ZteFile_Merge() { var testDirectory = AppDomain.CurrentDomain.BaseDirectory; var csvFilesDirectory = Path.Combine(testDirectory, "CsvFiles"); var path = Path.Combine(csvFilesDirectory, "NeighborCellZte.csv"); var reader = new StreamReader(path, Encoding.GetEncoding("GB2312")); var infos = NeighborCellZteCsv.ReadNeighborCellZteCsvs(reader); Assert.AreEqual(infos.Count, 998); }
public void UploadZteNeighbors(StreamReader reader) { var groupInfos = NeighborCellZteCsv.ReadNeighborCellZteCsvs(reader); foreach (var info in groupInfos) { var cell = NearestPciCell.ConstructCell(info, _cellRepository); if (cell.Pci >= 0) { NearestCells.Push(cell); } } }
public static NearestPciCell ConstructCell(NeighborCellZteCsv info, ICellRepository cellRepository) { var fields = info.NeighborRelation.GetSplittedFields(':'); var neighborCellId = fields[3].ConvertToInt(0); var neighborSectorId = fields[4].ConvertToByte(0); var neiborCell = neighborCellId > 10000 ? cellRepository.GetBySectorId(neighborCellId, neighborSectorId) : null; return(new NearestPciCell { CellId = info.ENodebId, SectorId = info.SectorId, NearestCellId = neighborCellId, NearestSectorId = neighborSectorId, Pci = neiborCell?.Pci ?? (short)-1, TotalTimes = info.IntraSystemTimes + info.InterSystemTimes }); }