public void Test_Construct(int eNodebId, byte sectorId, bool outdoor, string indoor, double height, double eTilt, double mTilt, int tac) { var cell = new Cell { ENodebId = eNodebId, SectorId = sectorId, IsOutdoor = outdoor, Height = height, ETilt = eTilt, MTilt = mTilt, Tac = tac }; var view = CellView.ConstructView(cell, _repository.Object); if (eNodebId > 0 && eNodebId <= 3) { Assert.AreEqual(view.ENodebName, "ENodeb-" + eNodebId); } else { Assert.IsNull(view.ENodebName); } Assert.AreEqual(view.ENodebId, eNodebId); Assert.AreEqual(view.SectorId, sectorId); Assert.AreEqual(view.Indoor, indoor); Assert.AreEqual(view.Height, height); Assert.AreEqual(view.DownTilt, eTilt + mTilt); Assert.AreEqual(view.Tac, tac); }
public IEnumerable <SectorView> QuerySectors(SectorRangeContainer container) { var cells = _repository.GetAllList(container.West, container.East, container.South, container.North) .Where(x => x.IsInUse).ToList(); if (container.ExcludedCells.Any()) { var excludeCells = from cell in cells join sector in container.ExcludedCells on new { CellId = cell.ENodebId, cell.SectorId } equals new { sector.CellId, sector.SectorId } select cell; cells = cells.Except(excludeCells).ToList(); } return(cells.Any() ? Mapper.Map <IEnumerable <CellView>, IEnumerable <SectorView> >( cells.Select(x => CellView.ConstructView(x, _eNodebRepository))) : new List <SectorView>()); }
public IEnumerable <CellView> GetCellViews(int eNodebId) { var cells = _repository.GetAllList(eNodebId); return(cells.Any() ? cells.Select(x => CellView.ConstructView(x, _eNodebRepository)) : new List <CellView>()); }
public IEnumerable <SectorView> QuerySectors(double west, double east, double south, double north) { var cells = _repository.GetAllList(west, east, south, north); return(cells.Any() ? Mapper.Map <IEnumerable <CellView>, IEnumerable <SectorView> >( cells.Select(x => CellView.ConstructView(x, _eNodebRepository))) : new List <SectorView>()); }
public IEnumerable <SectorView> QuerySectors(int eNodebId) { var cells = _repository.GetAllList(eNodebId); return(cells.Any() ? Mapper.Map <IEnumerable <CellView>, IEnumerable <SectorView> >( cells.Select(x => CellView.ConstructView(x, _eNodebRepository))) : new List <SectorView>()); }
public IEnumerable <CellView> QueryByRruName(string rruName) { var rrus = _rruRepository.GetAllList(x => x.RruName.Contains(rruName)); return(from rru in rrus select _repository.FirstOrDefault(x => x.ENodebId == rru.ENodebId && x.LocalSectorId == rru.LocalSectorId) into cell where cell != null select CellView.ConstructView(cell, _eNodebRepository)); }
public IEnumerable <SectorView> QuerySectorsInUse(int eNodebId) { var cells = _repository.GetAllInUseList().Where(x => x.ENodebId == eNodebId).ToList(); return(cells.Any() ? Mapper.Map <IEnumerable <CellView>, IEnumerable <SectorView> >( cells.Select(x => CellView.ConstructView(x, _eNodebRepository))) : new List <SectorView>()); }
public IEnumerable <CellView> GetViews(string collegeName) { var ids = _repository.GetCellIds(collegeName); var query = ids.Select(_cellRepository.Get).Where(cell => cell != null).ToList(); return(query.Any() ? query.Select(x => CellView.ConstructView(x, _eNodebRepository)) : null); }
public IEnumerable <SectorView> QuerySectors(IEnumerable <string> collegeNames) { var ids = collegeNames.Select(x => _repository.GetCellIds(x)).Aggregate((x, y) => x.Concat(y)).Distinct(); var query = ids.Select(_cellRepository.Get).Where(cell => cell != null).ToList(); return(query.Any() ? Mapper.Map <IEnumerable <CellView>, IEnumerable <SectorView> >( query.Select(x => CellView.ConstructView(x, _eNodebRepository))) : null); }
public IEnumerable <CellView> GetNearbyCellsWithPci(int eNodebId, byte sectorId, short pci) { var cell = _repository.GetBySectorId(eNodebId, sectorId); if (cell == null) { return(new List <CellView>()); } return (GetCells(cell.Longtitute - 0.2, cell.Longtitute + 0.2, cell.Lattitute - 0.2, cell.Lattitute + 0.2) .Where(x => x.Pci == pci && sectorId < x.SectorId + 16 && x.SectorId < sectorId + 16) .Select(x => CellView.ConstructView(x, _eNodebRepository))); }
public IEnumerable <SectorView> GetCells(double west, double east, double south, double north) { var cells = _repository.GetAllList(x => x.Longtitute >= west && x.Longtitute <= east && x.Lattitute >= south && x.Lattitute <= north && x.IsInUse); return(cells.Any() ? Mapper.Map <IEnumerable <CellView>, IEnumerable <SectorView> >( cells.Select(x => CellView.ConstructView(x, _eNodebRepository))) : new List <SectorView>()); }
public IEnumerable <SectorView> QueryHotSpotSectors(string name) { var ids = _repository.GetAllList( x => x.HotspotName == name && x.InfrastructureType == InfrastructureType.Cell); var query = ids.Select(x => _cellRepository.GetBySectorId(x.ENodebId, x.SectorId)) .Where(cell => cell != null) .ToList(); return(query.Any() ? Mapper.Map <IEnumerable <CellView>, IEnumerable <SectorView> >( query.Select(x => CellView.ConstructView(x, _eNodebRepository))) : null); }
public CellView GetCell(int eNodebId, byte sectorId) { var cell = _repository.GetBySectorId(eNodebId, sectorId); return(cell == null ? null : CellView.ConstructView(cell, _eNodebRepository)); }