public IEnumerable <InterferenceMatrixView> QueryViews(DateTime begin, DateTime end, int cellId, byte sectorId) { var statList = _repository.GetAllList(begin, end, cellId, sectorId); var results = from stat in statList group stat by new { stat.ENodebId, stat.SectorId, stat.DestPci, stat.DestENodebId, stat.DestSectorId } into g select new InterferenceMatrixView { DestPci = g.Key.DestPci, DestENodebId = g.Key.DestENodebId, DestSectorId = g.Key.DestSectorId, Mod3Interferences = g.Average(x => x.Mod3Interferences), Mod6Interferences = g.Average(x => x.Mod6Interferences), OverInterferences10Db = g.Average(x => x.OverInterferences10Db), OverInterferences6Db = g.Average(x => x.OverInterferences6Db), InterferenceLevel = g.Average(x => x.InterferenceLevel), NeighborCellName = "未匹配小区" }; var views = results as InterferenceMatrixView[] ?? results.ToArray(); foreach (var result in views.Where(x => x.DestENodebId > 0)) { var eNodeb = _eNodebRepository.GetByENodebId(result.DestENodebId); result.NeighborCellName = eNodeb?.Name + "-" + result.DestSectorId; } return(views); }
private IMongoQuery <ENodebInterFreqHoView> ConstructENodebQuery(int eNodebId) { var eNodeb = _eNodebRepository.GetByENodebId(eNodebId); if (eNodeb == null) { return(null); } return(eNodeb.Factory == "华为" ? (IMongoQuery <ENodebInterFreqHoView>) new HuaweiInterFreqENodebQuery(_huaweiENodebHoRepository, eNodebId) : new ZteInterFreqENodebQuery(_zteMeasurementRepository, _zteGroupRepository, eNodebId)); }
private IMongoQuery <CellHuaweiMongo> ConstructQuery(int eNodebId, byte sectorId) { var eNodeb = _eNodebRepository.GetByENodebId(eNodebId); if (eNodeb == null) { return(null); } return(eNodeb.Factory == "华为" ? (IMongoQuery <CellHuaweiMongo>) new HuaweiCellQuery(_repository, eNodebId, sectorId) : new ZteCellQuery(_zteCellRepository, _zteMeasRepository, _ztePrachRepository, eNodebId, sectorId)); }
private IMongoQuery <List <NeighborCellMongo> > ConstructNeighborQuery(int eNodebId, byte sectorId) { var eNodeb = _eNodebRepository.GetByENodebId(eNodebId); if (eNodeb == null) { return(null); } return(eNodeb.Factory == "华为" ? (IMongoQuery <List <NeighborCellMongo> >) new HuaweiNeighborQuery(_cellRepository, _eNodebRepository, _huaweiCellRepository, _huaweiNeighborRepository, eNodebId, sectorId) : new ZteNeighborQuery(_cellRepository, _zteNeighborRepository, _zteExternalRepository, eNodebId, sectorId)); }
public static CellView ConstructView(Cell cell, IENodebRepository repository) { var view = Mapper.Map<Cell, CellView>(cell); var eNodeb = repository.GetByENodebId(cell.ENodebId); view.ENodebName = eNodeb?.Name; return view; }
public static Precise4GView ConstructView(PreciseCoverage4G stat, IENodebRepository repository) { var view = Mapper.Map<PreciseCoverage4G, Precise4GView>(stat); var eNodeb = repository.GetByENodebId(stat.CellId); view.ENodebName = eNodeb?.Name; return view; }
public static NearestPciCellView ConstructView(NearestPciCell stat, IENodebRepository repository) { var view = Mapper.Map<NearestPciCell, NearestPciCellView>(stat); var eNodeb = repository.GetByENodebId(stat.NearestCellId); view.NearestENodebName = eNodeb == null ? "Undefined" : eNodeb.Name; return view; }
public static Precise4GView ConstructView(PreciseCoverage4G stat, IENodebRepository repository) { var view = Mapper.Map <PreciseCoverage4G, Precise4GView>(stat); var eNodeb = repository.GetByENodebId(stat.CellId); view.ENodebName = eNodeb?.Name; return(view); }
public static CellPreciseKpiView ConstructView(Cell cell, IENodebRepository repository) { var view = Mapper.Map <Cell, CellPreciseKpiView>(cell); var eNodeb = repository.GetByENodebId(cell.ENodebId); view.ENodebName = eNodeb?.Name; return(view); }
public static NearestPciCellView ConstructView(NearestPciCell stat, IENodebRepository repository, ICellRepository cellRepository, IInfrastructureRepository infrastructureRepository) { var view = Mapper.Map <NearestPciCell, NearestPciCellView>(stat); var eNodeb = repository.GetByENodebId(stat.NearestCellId); view.NearestENodebName = eNodeb == null ? "Undefined" : eNodeb.Name; return(view); }
public int DumpNewEnodebExcels(IEnumerable <ENodebExcel> infos) { var containers = (from info in infos join town in _townRepository.GetAllList() on new { info.CityName, info.DistrictName, info.TownName } equals new { town.CityName, town.DistrictName, town.TownName } select new ENodebExcelWithTownIdContainer { ENodebExcel = info, TownId = town.Id }).ToArray(); if (!containers.Any()) { return(0); } var items = Mapper.Map <IEnumerable <ENodebExcelWithTownIdContainer>, List <ENodebWithTownIdContainer> >(containers); items.ForEach(x => { x.ENodeb.TownId = x.TownId; }); var count = 0; foreach (var eNodeb in items.Select(x => x.ENodeb).ToList()) { var item = _eNodebRepository.GetByENodebId(eNodeb.ENodebId); if (item == null) { var result = _eNodebRepository.Insert(eNodeb); if (result != null) { count++; } } else { item.IsInUse = true; _eNodebRepository.Update(item); } } _eNodebRepository.SaveChanges(); return(count); }
private IMongoQuery <CellPower> ConstructQuery(int eNodebId, byte sectorId) { var eNodeb = _eNodebRepository.GetByENodebId(eNodebId); if (eNodeb == null) { return(null); } return(eNodeb.Factory == "华为" ? (IMongoQuery <CellPower>) new HuaweiCellPowerQuery(_huaweiCellRepository, _huaweiPbRepository, _huaweiPaRepository, eNodebId, sectorId) : new ZteCellPowerQuery(_ztePbRepository, _ztePaRepository, eNodebId, sectorId)); }
public void UpdateTown(IENodebRepository eNodebRepository, ITownRepository townRepository) { var eNodeb = eNodebRepository.GetByENodebId(ENodebId); if (eNodeb == null) { return; } ENodebName = eNodeb.Name; var town = eNodeb.TownId == -1 ? null : townRepository.Get(eNodeb.TownId); if (town == null) { return; } City = town.CityName; District = town.DistrictName; Town = town.TownName; }
public List <NeighborCellMongo> Query() { var neighborCell = _cellRepository.GetBySectorId(_destENodebId, _destSectorId); var neighborPci = neighborCell?.Pci; var neighborENodeb = _eNodebRepository.GetByENodebId(_destENodebId); var neighborCellName = neighborENodeb?.Name ?? "未知基站" + "-" + _destSectorId; var huaweiNeighbors = _huaweiNeighborRepository.GetReverseList(_destENodebId, _destSectorId); return(huaweiNeighbors.Select(x => { var result = Mapper.Map <EutranIntraFreqNCell, NeighborCellMongo>(x); result.NeighborPci = neighborPci ?? 0; result.NeighborCellName = neighborCellName; result.NeighborCellId = _destENodebId; result.NeighborSectorId = _destSectorId; var huaweiCell = _huaweiCellRepository.GetByLocal(x.eNodeB_Id, x.LocalCellId); result.SectorId = (byte?)(huaweiCell?.CellId) ?? 255; return result; }).ToList()); }
public IEnumerable <College4GTestView> GetViews(DateTime date, int hour) { var statTime = date.AddHours(hour); var results = _repository.GetAllList().Where(x => x.TestTime == statTime).ToList(); if (!results.Any()) { return(new List <College4GTestView>()); } return(results.Select(x => { var college = _collegeRepository.Get(x.CollegeId); var eNodeb = _eNodebRepository.GetByENodebId(x.ENodebId); var cell = eNodeb == null ? null : _cellRepository.GetBySectorId(x.ENodebId, x.SectorId); var view = x.MapTo <College4GTestView>(); view.CollegeName = college?.Name; view.CellName = eNodeb?.Name + "-" + x.SectorId; view.Pci = cell?.Pci ?? -1; return view; })); }
public List <NeighborCellMongo> Query() { var huaweiCell = _huaweiCellRepository.GetRecent(_eNodebId, _sectorId); var localCellId = huaweiCell?.LocalCellId ?? _sectorId; var huaweiNeighbors = _huaweiNeighborRepository.GetRecentList(_eNodebId, (byte)localCellId); var results = Mapper.Map <List <EutranIntraFreqNCell>, List <NeighborCellMongo> >(huaweiNeighbors); results.ForEach(x => { x.SectorId = _sectorId; var neighborCell = _cellRepository.GetBySectorId(x.NeighborCellId, x.NeighborSectorId); if (neighborCell != null) { x.NeighborPci = neighborCell.Pci; } var neighborENodeb = _eNodebRepository.GetByENodebId(x.NeighborCellId); if (neighborENodeb != null) { x.NeighborCellName = neighborENodeb.Name + "-" + x.NeighborSectorId; } }); return(results); }
public ENodebView GetByENodebId(int eNodebId) { var item = _eNodebRepository.GetByENodebId(eNodebId); return(item?.MapTo <ENodebView>()); }
public void UpdateTown(IENodebRepository eNodebRepository, ITownRepository townRepository) { var eNodeb = eNodebRepository.GetByENodebId(ENodebId); if (eNodeb == null) return; ENodebName = eNodeb.Name; var town = eNodeb.TownId == -1 ? null : townRepository.Get(eNodeb.TownId); if (town == null) return; City = town.CityName; District = town.DistrictName; Town = town.TownName; }