Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        public List <TopPrecise4GContainer> GetTopCountStats(DateTime begin, DateTime end, int topCount,
                                                             OrderPreciseStatPolicy policy)
        {
            var query =
                _repository.GetAllList(x => x.StatTime >= begin && x.StatTime <end && x.TotalMrs> Settings.Default.TotalMrsThreshold);
            var result = query.GenerateContainers();

            var orderResult = result.Order(policy, topCount);

            return(orderResult);
        }
Esempio n. 3
0
        public IEnumerable <TownPreciseView> GetMergeStats(DateTime statTime)
        {
            var stats     = _repository.GetAllList(statTime.Date, statTime.Date.AddDays(1));
            var townStats = GetTownStats(stats);

            var mergeStats = from stat in townStats
                             group stat by stat.TownId
                             into g
                             select new TownPreciseCoverage4GStat
            {
                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
            };

            return(mergeStats.Select(x => x.ConstructView <TownPreciseCoverage4GStat, TownPreciseView>(_townRepository)));
        }
        public IEnumerable <PreciseHistory> GetPreciseHistories(DateTime begin, DateTime end)
        {
            var results = new List <PreciseHistory>();

            while (begin < end.AddDays(1))
            {
                var beginDate = begin.Date;
                var endDate   = beginDate.AddDays(1);
                var items     = _repository.GetAllList(beginDate, endDate);
                var townItems = _regionRepository.GetAllList(beginDate, endDate);
                results.Add(new PreciseHistory
                {
                    DateString       = begin.ToShortDateString(),
                    PreciseStats     = items.Count,
                    TownPreciseStats = townItems.Count
                });
                begin = begin.AddDays(1);
            }
            return(results);
        }
 public IEnumerable <PreciseCoverage4G> GetTimeSpanStats(int cellId, byte sectorId, DateTime begin, DateTime end)
 {
     return(_repository.GetAllList(cellId, sectorId, begin, end).OrderBy(x => x.StatTime));
 }