Example #1
0
        private async Task LoadDatas()
        {
            Demo.WeaponFired = await _cacheService.GetDemoWeaponFiredAsync(Demo);

            CurrentRound     = Demo.Rounds.First(r => r.Number == RoundNumber);
            PeriodStart      = DateTime.Today;
            PeriodEnd        = DateTime.Today.AddSeconds(CurrentRound.Duration);
            VisibleStartTime = PeriodStart.AddSeconds(-5);
            VisibleEndTime   = PeriodEnd.AddSeconds(5);
            RoundEventList   = await _roundService.GetTimeLineEventList(Demo, CurrentRound);

            PlayersStats = await _playerService.GetPlayerRoundStatsListAsync(Demo, CurrentRound);
        }
Example #2
0
        private void RunCalc()
        {
            bool e;

            using (StartView(ViewAtom.Calc, true))
            {
                if (Form != null)
                {
                    Form.Invoke(new FormDelegate(UpdateFormTime));
                }
                //Подготовка рачета
                Start(PrepareCalc, 0, 25);
                //Расчет
                if (!Start(Cycle, 25) && !IsPeriodic)
                {
                    using (StartAtom(Atom.Stop)) { }
                }
                e = Command.IsError;
            }

            //Периодический расчет
            if (IsPeriodic)
            {
                while (!e && PeriodEnd.AddSeconds(1) < StopTime)
                {
                    PeriodBegin = PeriodBegin.AddMinutes(PeriodLength);
                    if (Form != null)
                    {
                        Form.Invoke(new FormDelegate(UpdateFormTime));
                    }
                    using (StartAtom(Atom.Next)) { }
                    StartView(ViewAtom.Calc, Cycle, true);
                    e |= Command.IsError;
                }
            }
        }