public void Reset()
 {
     this.summary = new PerformanceSummary(pattern);
     timer.Reset();
     matcher.Reset();
     playedBeatsBuffer = new System.Collections.Concurrent.ConcurrentQueue <TimedEvent <Beat> >();
 }
Example #2
0
        public SummaryViewModel()
        {
            _setUpModel();

            Messenger.Default.Register <PerformanceTick>(this, _updateSeries);
            Messenger.Default.Register <PerformanceSummary>(this, (summary) => PerformanceSummary = summary);
        }
Example #3
0
        override public bool Go(PerformanceSummary psDest)
        {
            string[] lines = File.ReadAllLines(Path.Combine(
                                                   _conf.PerformanceResultDir(),
                                                   ResultFN()));

            decimal avgTotalMinutes = 0;
            int     nMeasurements   = 0;

            for (int i = 0; i < lines.Length; i++)
            {
                decimal totalMinutes;
                if (extractOneResult(lines[i], out totalMinutes))
                {
                    nMeasurements++;
                    avgTotalMinutes += totalMinutes;
                }
            }
            if (nMeasurements == 0)
            {
                //REPERR: no measurement results
                return(false);
            }
            avgTotalMinutes /= nMeasurements;

            XmlElement useCaseElm       = psDest.PutUseCase(ExternalName());
            XmlElement mObjectiveElm    = psDest.PutObjectiveMetric(useCaseElm, avgTotalMinutes);
            XmlElement mElapsedTimeMins = psDest.PutElapsedTimeMins(useCaseElm, avgTotalMinutes);

            return(true);
        }
Example #4
0
        override public bool Go(PerformanceSummary psDest)
        {
            string[] lines = File.ReadAllLines(Path.Combine(
                                                   _conf.PerformanceResultDir(),
                                                   ResultFN()));

            decimal elapsedTime = invalidValue();

            for (int i = 0; i < lines.Length; i++)
            {
                if (extractAverageTime(lines[i], out elapsedTime))
                {
                    break;
                }
            }
            if (IsInvalidValue(elapsedTime))
            {
                //REPERR: no objective value in the measurement result
                return(false);
            }
            XmlElement useCaseElm       = psDest.PutUseCase(ExternalName());
            XmlElement mObjectiveElm    = psDest.PutObjectiveMetric(useCaseElm, elapsedTime);
            XmlElement mElapsedTimeMins = psDest.PutElapsedTimeMins(useCaseElm, elapsedTime / 60);

            return(true);
        }
Example #5
0
        protected override void OnUpdate(UpdateEventArgs updateArgs)
        {
            if (updateArgs.ElapsedTimeInS < 0.0001)
            {
                // This is basically to skip the first frame, because its
                // elapsed time is out of whack. We do a GC though, to clean up
                // initialization garbage, to prevent that from happening in
                // game This saves one big stutter a few seconds into the game.
                GC.Collect();
                return;
            }


            var performanceSummary = new PerformanceSummary(
                _performanceMonitor.FrameTime.Stats,
                _performanceMonitor.ElapsedTime.Stats,
                _performanceMonitor.FrameTime.CurrentValue,
                _gameStatistics.NrGameObjects);
            var e = new BeardedUpdateEventArgs(updateArgs, performanceSummary);

            _performanceMonitor.StartFrame(e.UpdateEventArgs.ElapsedTimeInS);

            _inputManager.Update(Focused);
            if (_inputManager.IsKeyPressed(Key.AltLeft) && _inputManager.IsKeyPressed(Key.F4))
            {
                Close();
            }

            _screenManager.Update(e);

            _performanceMonitor.EndFrame();
            _afterFrame?.Invoke(this, e);
        }
Example #6
0
 public void Draw(SKCanvas canvas, SKRect gridRect, PerformanceSummary summary)
 {
     canvas.Save();
     canvas.Translate(0, gridRect.Height);
     foreach (var beat in pattern.Ids)
     {
         var beatInfo       = pattern.Beat(beat);
         var summaryForBeat = summary.BeatSummary(beat);
         var point          = gridCoordinates.Coordinates(beatInfo.Sound.Instrument, beatInfo.T);
         PrintBeatSummary(canvas, point, summaryForBeat);
     }
     canvas.Restore();
 }
        public PageAnalysis AnalyzeWebPage(string url, string focusKeyword)
        {
            var webpage = new PageAnalysis
            {
                Url = url,
            };

            try
            {
                webpage.HtmlResult = GetHtml(url);

                var keywordAnalyzer = new KeywordSummary(webpage.HtmlResult);
                keywordAnalyzer.FocusKeyword = focusKeyword;
                webpage.AnalyzerResults.Add(new AnalyzerResult
                {
                    Alias    = "keywordanalyzer",
                    Analysis = keywordAnalyzer.GetAnalysis()
                });

                var htmlAnalyzer = new HtmlSummary(webpage.HtmlResult);
                webpage.AnalyzerResults.Add(new AnalyzerResult
                {
                    Alias    = "htmlanalyzer",
                    Analysis = htmlAnalyzer.GetAnalysis()
                });

                var performanceAnalyzer = new PerformanceSummary(webpage.HtmlResult);
                webpage.AnalyzerResults.Add(new AnalyzerResult
                {
                    Alias    = "performanceanalyzer",
                    Analysis = performanceAnalyzer.GetAnalysis()
                });
            }
            catch (WebException ex)
            {
                webpage.Status = ((HttpWebResponse)ex.Response).StatusCode;
            }
            return(webpage);
        }
Example #8
0
 public void Clear()
 {
     beatsDrawer.ClearBeats();
     summary = null;
 }
Example #9
0
 public void SetSummary(PerformanceSummary summary)
 {
     this.summary = summary;
 }
Example #10
0
 public override void Update(BeardedUpdateEventArgs args)
 {
     _stats = args.PerformanceStats;
 }