public IEnumerable <TownPreciseView> GetMergeStats(DateTime statTime, FrequencyBandType frequency = FrequencyBandType.All) { var mergeStats = GetTownPreciseStats(statTime, frequency); return(mergeStats.Select(x => x.ConstructView <TownPreciseStat, TownPreciseView>(_townRepository))); }
public static void MockFrequencyType(this Mock <IBroadcastModel> model, FrequencyBandType type) { switch (type) { case FrequencyBandType.Downlink2100: model.SetupGet(x => x.Frequency).Returns(2120); break; case FrequencyBandType.Uplink2100: model.SetupGet(x => x.Frequency).Returns(1930); break; case FrequencyBandType.Downlink1800: model.SetupGet(x => x.Frequency).Returns(1860); break; case FrequencyBandType.Uplink1800: model.SetupGet(x => x.Frequency).Returns(1765); break; case FrequencyBandType.Tdd2600: model.SetupGet(x => x.Frequency).Returns(2645); break; default: model.SetupGet(x => x.Frequency).Returns(2120); break; } }
public void SetFrequencyBand(FrequencyBandType type) { switch (type) { case FrequencyBandType.Downlink2100: Frequency = 2120; break; case FrequencyBandType.Uplink2100: Frequency = 1930; break; case FrequencyBandType.Downlink1800: Frequency = 1860; break; case FrequencyBandType.Uplink1800: Frequency = 1765; break; case FrequencyBandType.Tdd2600: Frequency = 2645; break; default: Frequency = 2120; break; } }
public IEnumerable <TownMrsSinrUl> GetMergeMrsStats(DateTime statTime, FrequencyBandType bandType) { var end = statTime.AddDays(1); var stats = _mrsSinrUlRepository.GetAllList(x => x.StatDate >= statTime && x.StatDate < end); var townStats = stats.GetTownFrequencyStats <MrsSinrUlStat, TownMrsSinrUlDto, TownMrsSinrUl>(bandType, _cellRepository, _eNodebRepository); var mergeStats = from stat in townStats group stat by stat.TownId into g select new TownMrsSinrUl { TownId = g.Key, StatDate = statTime, SinrUlBelowM9 = g.Sum(x => x.SinrUlBelowM9), SinrUlM9ToM6 = g.Sum(x => x.SinrUlM9ToM6), SinrUlM6ToM3 = g.Sum(x => x.SinrUlM6ToM3), SinrUlM3To0 = g.Sum(x => x.SinrUlM3To0), SinrUl0To3 = g.Sum(x => x.SinrUl0To3), SinrUl3To6 = g.Sum(x => x.SinrUl3To6), SinrUl6To9 = g.Sum(x => x.SinrUl6To9), SinrUl9To12 = g.Sum(x => x.SinrUl9To12), SinrUl12To15 = g.Sum(x => x.SinrUl12To15), SinrUl15To18 = g.Sum(x => x.SinrUl15To18), SinrUl18To21 = g.Sum(x => x.SinrUl18To21), SinrUl21To24 = g.Sum(x => x.SinrUl21To24), SinrUlAbove24 = g.Sum(x => x.SinrUlAbove24), FrequencyBandType = bandType }; return(mergeStats); }
public List <Cell> GetHuaweiCellsByBandType(FrequencyBandType frequency) { switch (frequency) { case FrequencyBandType.Band2100: return (_repository.GetAllList( x => x.BandClass == 1 && ((x.ENodebId >= 499712 && x.ENodebId < 501248) || (x.ENodebId >= 552448 && x.ENodebId < 552960) || (x.ENodebId >= 870144 && x.ENodebId < 870460)))); case FrequencyBandType.Band1800: return(_repository.GetAllList( x => x.BandClass == 3 && ((x.ENodebId >= 499712 && x.ENodebId < 501248) || (x.ENodebId >= 552448 && x.ENodebId < 552960) || (x.ENodebId >= 870144 && x.ENodebId < 870460)))); default: return(_repository.GetAllList( x => x.BandClass == 5 && ((x.ENodebId >= 499712 && x.ENodebId < 501248) || (x.ENodebId >= 552448 && x.ENodebId < 552960) || (x.ENodebId >= 870144 && x.ENodebId < 870460)))); } }
public static List <TStat> QueryZteFlows <TStat, TRepository>(this TRepository zteRepository, FrequencyBandType frequency, DateTime begin, DateTime end) where TStat : Entity, IStatTime, ILteCellQuery where TRepository : IRepository <TStat> { switch (frequency) { case FrequencyBandType.All: return(zteRepository.GetAllList(x => x.StatTime >= begin && x.StatTime < end)); case FrequencyBandType.Band2100: return (zteRepository.GetAllList( x => x.StatTime >= begin && x.StatTime < end && x.SectorId < 16)); case FrequencyBandType.Band1800: return (zteRepository.GetAllList( x => x.StatTime >= begin && x.StatTime < end && x.SectorId >= 48 && x.SectorId < 64)); default: return (zteRepository.GetAllList( x => x.StatTime >= begin && x.StatTime < end && x.SectorId >= 16 && x.SectorId < 32)); } }
public IEnumerable <TownMrsRsrp> GetMergeMrsStats(DateTime statTime, FrequencyBandType bandType) { var end = statTime.AddDays(1); var stats = _mrsRsrpRepository.GetAllList(x => x.StatDate >= statTime && x.StatDate < end); var townStats = stats.GetTownFrequencyStats <MrsRsrpStat, TownMrsRsrpDto, TownMrsRsrp>(bandType, _cellRepository, _eNodebRepository); var mergeStats = from stat in townStats group stat by stat.TownId into g select new TownMrsRsrp { TownId = g.Key, StatDate = statTime, Rsrp100To95 = g.Sum(x => x.Rsrp100To95), Rsrp105To100 = g.Sum(x => x.Rsrp105To100), Rsrp110To105 = g.Sum(x => x.Rsrp110To105), Rsrp115To110 = g.Sum(x => x.Rsrp115To110), Rsrp120To115 = g.Sum(x => x.Rsrp120To115), Rsrp70To60 = g.Sum(x => x.Rsrp70To60), Rsrp80To70 = g.Sum(x => x.Rsrp80To70), Rsrp90To80 = g.Sum(x => x.Rsrp90To80), Rsrp95To90 = g.Sum(x => x.Rsrp95To90), RsrpAbove60 = g.Sum(x => x.RsrpAbove60), RsrpBelow120 = g.Sum(x => x.RsrpBelow120), FrequencyBandType = bandType, Id = 0 }; return(mergeStats); }
private IEnumerable <TownPreciseStat> GetTownPreciseStats(DateTime statTime, FrequencyBandType frequency) { var stats = _repository.GetAllList(statTime.Date, statTime.Date.AddDays(1), frequency); var townStats = GetTownStats(stats); var mergeStats = from stat in townStats group stat by stat.TownId into g select new TownPreciseStat { TownId = g.Key, FirstNeighbors = g.Sum(x => x.FirstNeighbors), SecondNeighbors = g.Sum(x => x.SecondNeighbors), ThirdNeighbors = g.Sum(x => x.ThirdNeighbors), TotalMrs = g.Sum(x => x.TotalMrs), InterFirstNeighbors = g.Sum(x => x.InterFirstNeighbors), InterSecondNeighbors = g.Sum(x => x.InterSecondNeighbors), InterThirdNeighbors = g.Sum(x => x.InterThirdNeighbors), NeighborsMore = g.Sum(x => x.NeighborsMore), StatTime = statTime, FrequencyBandType = frequency }; return(mergeStats); }
public List <TownHourCqi> GetTownCqiStats(DateTime statDate, FrequencyBandType bandType) { var end = statDate.AddDays(1); var userses = _usersRepository.GetAllList(x => x.StatTime >= statDate && x.StatTime < end); var townStatList = userses.GetTownFrequencyItems <HourCqi, TownHourCqi>(bandType, _cellRepository, _eNodebRepository); return(townStatList.ToList()); }
public TownFlowStat QueryOneDateBandStat(DateTime statDate, FrequencyBandType frequency) { var end = statDate.AddDays(1); var result = _repository .GetAllList(x => x.StatTime >= statDate && x.StatTime < end && x.FrequencyBandType == frequency); return(result.Any() ? result.ArraySum() : null); }
public IEnumerable <TownPrbStat> QueryCurrentDateStats(DateTime currentDate, FrequencyBandType frequency) { var beginDate = currentDate.Date; var endDate = beginDate.AddDays(1); return (_repository.GetAllList( x => x.StatTime >= beginDate && x.StatTime < endDate && x.FrequencyBandType == frequency)); }
public IEnumerable <ENodebFlowView> GetENodebFlowViews(DateTime begin, DateTime end, FrequencyBandType frequency = FrequencyBandType.All) { var eNodebStatList = new List <ENodebFlowView>(); var zteFlows = _zteRepository.QueryZteFlows <FlowZte, IFlowZteRepository>(frequency, begin, end); var huaweiFlows = QueryHuaweiFlows(begin, end, frequency); var eNodebs = _eNodebRepository.GetAllList(); return(GenerateENodebFlowViews(eNodebStatList, huaweiFlows, eNodebs, zteFlows)); }
private List <TownDoubleFlowView> QueryTownDoubleFlowViews(DateTime begin, DateTime end, string city, FrequencyBandType frequency) { var query = _repository.GetAllList(x => x.StatTime >= begin && x.StatTime < end && x.FrequencyBandType == frequency) .OrderBy(x => x.StatTime) .ToList(); var townViews = query.QueryTownStat <TownDoubleFlow, TownDoubleFlowView>(_townRepository, city); return(townViews); }
public IEnumerable <ENodebFlowView> GetENodebFlowViews(DateTime begin, DateTime end, string city, string district, string town, FrequencyBandType frequency = FrequencyBandType.All) { var eNodebStatList = new List <ENodebFlowView>(); var zteFlows = _zteRepository.QueryZteFlows <FlowZte, IFlowZteRepository>(frequency, begin, end); var huaweiFlows = QueryHuaweiFlows(begin, end, frequency); var eNodebs = _cellService.GetTownENodebs(city, district, town); return(GenerateENodebFlowViews(eNodebStatList, huaweiFlows, eNodebs, zteFlows)); }
public IEnumerable <CellFlowView> GetOutdoorCellFlowViews(DateTime begin, DateTime end, string city, string district, string town, FrequencyBandType frequency = FrequencyBandType.All) { var cellStatList = new List <CellFlowView>(); var zteFlows = _zteRepository.QueryZteFlows <FlowZte, IFlowZteRepository>(frequency, begin, end); var huaweiFlows = QueryHuaweiFlows(begin, end, frequency); var cells = _cellService.GetOutdoorTownCells(city, district, town, frequency); return(GenerateCellFlowViews(cellStatList, huaweiFlows, cells, zteFlows)); }
public IEnumerable <TownFlowView> QueryLastDateView(DateTime initialDate, FrequencyBandType frequency = FrequencyBandType.All) { var stats = _repository.QueryLastDate(initialDate, (repository, beginDate, endDate) => repository.GetAllList(x => x.StatTime >= beginDate && x.StatTime < endDate && x.FrequencyBandType == frequency) .OrderBy(x => x.StatTime) .ToList()); return(stats.Select(x => x.ConstructView <TownFlowStat, TownFlowView>(_townRepository))); }
public List <TownPrbStat> GetTownPrbStats(DateTime statDate, FrequencyBandType frequency = FrequencyBandType.All) { var end = statDate.AddDays(1); var townStatList = new List <TownPrbStat>(); var huaweiPrbs = _prbHuaweiRepository.QueryZteFlows <PrbHuawei, IPrbHuaweiRepository>(frequency, statDate, end); townStatList.AddRange(huaweiPrbs.GetTownStats <PrbHuawei, TownPrbStat>(_eNodebRepository)); var ztePrbs = _prbZteRepository.QueryZteFlows <PrbZte, IPrbZteRepository>(frequency, statDate, end); townStatList.AddRange(ztePrbs.GetTownStats <PrbZte, TownPrbStat>(_eNodebRepository)); return(townStatList); }
public List <TownDoubleFlow> QueryTownDoubleFlowViews(DateTime begin, DateTime end, int townId, FrequencyBandType frequency) { var query = _repository.GetAllList( x => x.StatTime >= begin && x.StatTime < end && x.FrequencyBandType == frequency && x.TownId == townId) .OrderBy(x => x.StatTime) .ToList(); return(query); }
public List <TownDoubleFlow> GetTownDoubleFlowStats(DateTime statDate, FrequencyBandType frequency = FrequencyBandType.All) { var end = statDate.AddDays(1); var townStatList = new List <TownDoubleFlow>(); var huaweiStats = _doubleFlowHuaweiRepository.QueryZteFlows <DoubleFlowHuawei, IDoubleFlowHuaweiRepository>(frequency, statDate, end); townStatList.AddRange(huaweiStats.GetTownStats <DoubleFlowHuawei, TownDoubleFlow>(_eNodebRepository)); var zteStats = _doubleFlowZteRepository.QueryZteFlows <DoubleFlowZte, IDoubleFlowZteRepository>(frequency, statDate, end); townStatList.AddRange(zteStats.GetTownStats <DoubleFlowZte, TownDoubleFlow>(_eNodebRepository)); return(townStatList); }
public IEnumerable <TownFlowView> QueryLastDateView(DateTime initialDate, string city, string district, FrequencyBandType frequency = FrequencyBandType.All) { var towns = _townRepository.GetAllList(x => x.CityName == city && x.DistrictName == district); var stats = _repository.QueryLastDate(initialDate, (repository, beginDate, endDate) => repository.GetAllList(x => x.StatTime >= beginDate && x.StatTime < endDate && x.FrequencyBandType == frequency) .OrderBy(x => x.StatTime) .ToList()); var filterStats = from s in stats join t in towns on s.TownId equals t.Id select s; return(filterStats.Select(x => x.ConstructView <TownFlowStat, TownFlowView>(_townRepository))); }
public IEnumerable <FlowRegionDateView> QueryDateSpanStats(DateTime begin, DateTime end, string city, FrequencyBandType frequency = FrequencyBandType.All) { var townViews = QueryTownFlowViews(begin, end, city, frequency); return(from view in townViews group view by view.StatTime into g select new FlowRegionDateView { StatDate = g.Key, TownViews = g.Select(x => x), DistrictViews = g.Select(x => x).Merge(v => v.MapTo <DistrictFlowView>()) }); }
private void TestDifferentUrbanTypesWithFrequency(FrequencyBandType ftype, double distance, bool farEnough) { model = new BroadcastModel(ftype, UrbanType.Dense); double d1 = model.CalculatePathLoss(distance, 40); model = new BroadcastModel(ftype); double d2 = model.CalculatePathLoss(distance, 40); model = new BroadcastModel(ftype, UrbanType.Middle); double d3 = model.CalculatePathLoss(distance, 40); if (farEnough) { Assert.IsTrue(d1 > d2, "d1 = {0}, d2 = {1}", d1, d2); } else { Assert.IsTrue(d1 < d2, "d1 = {0}, d2 = {1}", d1, d2); } Assert.IsTrue(d2 > d3, "d2 = {0}, d3 = {1}", d2, d3); }
private void TestDifferentUrbanTypesWithFrequency(FrequencyBandType ftype, double distance, bool farEnough) { model.MockFrequencyType(ftype); model.MockUrbanTypeAndKValues(UrbanType.Dense); double d1 = model.Object.CalculatePathLoss(distance, 40); model.MockUrbanTypeAndKValues(UrbanType.Large); double d2 = model.Object.CalculatePathLoss(distance, 40); model.MockUrbanTypeAndKValues(UrbanType.Middle); double d3 = model.Object.CalculatePathLoss(distance, 40); if (farEnough) { Assert.IsTrue(d1 > d2, "d1 = {0}, d2 = {1}", d1, d2); } else { Assert.IsTrue(d1 < d2, "d1 = {0}, d2 = {1}", d1, d2); } Assert.IsTrue(d2 > d3, "d2 = {0}, d3 = {1}", d2, d3); }
private List <FlowHuawei> QueryHuaweiFlows(DateTime begin, DateTime end, FrequencyBandType frequency) { var huaweiFlows = _huaweiRepository.GetAllList(x => x.StatTime >= begin && x.StatTime < end); if (frequency == FrequencyBandType.All) { return(huaweiFlows); } var cells = _cellService.GetHuaweiCellsByBandType(frequency); huaweiFlows = (from f in huaweiFlows join c in cells on new { f.ENodebId, f.LocalCellId } equals new { c.ENodebId, LocalCellId = c.LocalSectorId } select f).ToList(); return(huaweiFlows); }
public List <Cell> GetAllList(FrequencyBandType bandType) { switch (bandType) { case FrequencyBandType.Band800VoLte: return(GetAllList(x => x.BandClass == 5 && x.Frequency < 2500)); case FrequencyBandType.Band1800: return(GetAllList(x => x.BandClass == 3)); case FrequencyBandType.Band2100: return(GetAllList(x => x.BandClass == 1)); default: return(GetAllList()); } }
public IEnumerable <TownMrsTadv> GetMergeMrsStats(DateTime statTime, FrequencyBandType bandType) { var end = statTime.AddDays(1); var stats = _mrsTadvRepository.GetAllList(x => x.StatDate >= statTime && x.StatDate < end); var townStats = stats.GetTownFrequencyStats <MrsTadvStat, TownMrsTadvDto, TownMrsTadv>(bandType, _cellRepository, _eNodebRepository); var mergeStats = from stat in townStats group stat by stat.TownId into g select new TownMrsTadv { TownId = g.Key, StatDate = statTime, TadvBelow1 = g.Sum(x => x.TadvBelow1), Tadv1To2 = g.Sum(x => x.Tadv1To2), Tadv2To3 = g.Sum(x => x.Tadv2To3), Tadv3To4 = g.Sum(x => x.Tadv3To4), Tadv4To6 = g.Sum(x => x.Tadv4To6), Tadv6To8 = g.Sum(x => x.Tadv6To8), Tadv8To10 = g.Sum(x => x.Tadv8To10), Tadv10To12 = g.Sum(x => x.Tadv10To12), Tadv12To14 = g.Sum(x => x.Tadv12To14), Tadv14To16 = g.Sum(x => x.Tadv14To16), Tadv16To18 = g.Sum(x => x.Tadv16To18), Tadv18To20 = g.Sum(x => x.Tadv18To20), Tadv20To24 = g.Sum(x => x.Tadv20To24), Tadv24To28 = g.Sum(x => x.Tadv24To28), Tadv28To32 = g.Sum(x => x.Tadv28To32), Tadv32To36 = g.Sum(x => x.Tadv32To36), Tadv36To42 = g.Sum(x => x.Tadv36To42), Tadv42To48 = g.Sum(x => x.Tadv42To48), Tadv48To54 = g.Sum(x => x.Tadv48To54), Tadv54To60 = g.Sum(x => x.Tadv54To60), Tadv60To80 = g.Sum(x => x.Tadv60To80), Tadv80To112 = g.Sum(x => x.Tadv80To112), Tadv112To192 = g.Sum(x => x.Tadv112To192), TadvAbove192 = g.Sum(x => x.TadvAbove192), FrequencyBandType = bandType, Id = 0 }; return(mergeStats); }
public static IEnumerable <TView> QueryTownFlowViews <TView, TZte, THuawei>(this ICellRepository huaweiCellRepository, string city, string district, string town, List <TZte> zteStats, List <THuawei> huaweiStats, FrequencyBandType frequency, ITownRepository townRepository, IENodebRepository eNodebRepository) where TZte : ILteCellQuery where THuawei : ILocalCellQuery where TView : class, IENodebName, ILteCellQuery, new() { var eNodebs = townRepository.QueryENodebs(eNodebRepository, city, district, town); if (!eNodebs.Any()) { return(new List <TView>()); } var zteViews = eNodebs.QueryZteViews <TView, TZte>(zteStats); var huaweiList = eNodebs.QueryHuaweiViews <TView, THuawei>(huaweiStats, huaweiCellRepository); IEnumerable <Tuple <TView, byte> > huaweiViews; switch (frequency) { case FrequencyBandType.All: huaweiViews = huaweiList; break; case FrequencyBandType.Band2100: huaweiViews = huaweiList.Where(x => x.Item2 < 16); break; case FrequencyBandType.Band1800: huaweiViews = huaweiList.Where(x => x.Item2 >= 48 && x.Item2 < 64); break; default: huaweiViews = huaweiList.Where(x => x.Item2 >= 16 && x.Item2 < 32); break; } return(zteViews.Concat(huaweiViews.Select(v => { var view = v.Item1; view.SectorId = v.Item2; return view; })).ToList()); }
private List <Cell> GetCellsByBandType(FrequencyBandType frequency) { List <Cell> cells; switch (frequency) { case FrequencyBandType.Band2100: cells = _cellRepository.GetAllList(x => x.BandClass == 1); break; case FrequencyBandType.Band1800: cells = _cellRepository.GetAllList(x => x.BandClass == 3); break; default: cells = _cellRepository.GetAllList(x => x.BandClass == 5); break; } return(cells); }
private List <TownFlowStat> GetTownFlowStats(DateTime statDate, FrequencyBandType frequency = FrequencyBandType.All) { var end = statDate.AddDays(1); var townStatList = new List <TownFlowStat>(); var huaweiFlows = _huaweiRepository.GetAllList(x => x.StatTime >= statDate && x.StatTime < end); var zteFlows = _service.QueryZteFlows(frequency, statDate, end); if (frequency != FrequencyBandType.All) { var cells = _cellService.GetHuaweiCellsByBandType(frequency); huaweiFlows = (from f in huaweiFlows join c in cells on new { f.ENodebId, f.LocalCellId } equals new { c.ENodebId, LocalCellId = c.LocalSectorId } select f).ToList(); } townStatList.AddRange(huaweiFlows.GetTownStats <FlowHuawei, TownFlowStat>(_eNodebRepository)); townStatList.AddRange(zteFlows.GetTownStats <FlowZte, TownFlowStat>(_eNodebRepository)); return(townStatList); }
public async Task <int> GenerateTownStats(DateTime statDate, FrequencyBandType bandType) { var end = statDate.AddDays(1); var count = _townRepository.Count(x => x.StatDate >= statDate && x.StatDate < end && x.FrequencyBandType == bandType); if (count != 0) { return(count); } var townStatList = _statRepository.GetAllList(x => x.StatDate >= statDate && x.StatDate < end) .GetTownFrequencyQueryStats <CoverageStat, TownCoverageStat>(bandType, _cellRepository, _eNodebRepository); var statList = townStatList.GetDateMergeStats(statDate).ToList(); statList.ForEach(townStat => { townStat.FrequencyBandType = bandType; }); return(await _townRepository.UpdateMany(statList)); }
public List <PreciseCoverage4G> GetAllList(DateTime begin, DateTime end, FrequencyBandType frequency) { switch (frequency) { case FrequencyBandType.All: return(GetAllList(x => x.StatTime >= begin && x.StatTime < end)); case FrequencyBandType.Band800VoLte: return(GetAllList(x => x.StatTime >= begin && x.StatTime < end && x.SectorId >= 16 && x.SectorId < 32)); case FrequencyBandType.Band1800: return(GetAllList(x => x.StatTime >= begin && x.StatTime < end && x.SectorId >= 48 && x.SectorId < 64)); case FrequencyBandType.Band2100: return(GetAllList(x => x.StatTime >= begin && x.StatTime < end && x.SectorId < 16)); default: return(new List <PreciseCoverage4G>()); } }
public static void MockFrequencyType(this Mock<IBroadcastModel> model, FrequencyBandType type) { switch (type) { case FrequencyBandType.Downlink2100: model.SetupGet(x => x.Frequency).Returns(2120); break; case FrequencyBandType.Uplink2100: model.SetupGet(x => x.Frequency).Returns(1930); break; case FrequencyBandType.Downlink1800: model.SetupGet(x => x.Frequency).Returns(1860); break; case FrequencyBandType.Uplink1800: model.SetupGet(x => x.Frequency).Returns(1765); break; case FrequencyBandType.Tdd2600: model.SetupGet(x => x.Frequency).Returns(2645); break; default: model.SetupGet(x => x.Frequency).Returns(2120); break; } }