Ejemplo n.º 1
0
        private void prepareEvents()
        {
            foreach (var e in _ctx.StatsEvent)
            {
                if (e.TopicId != -1 && e.TopicId != _reportParams.topic.Id)
                {
                    continue;
                }

                if (e.UserId != -1 && !_reportParams.requiredUsers.Contains(e.UserId))
                {
                    continue;
                }

                StatsEvents.Add(e);
                EventTotals.CountEvent((StEvent)e.Event, e.Id);

                //count per user stats
                if (e.UserId != -1)
                {
                    if (_perUserEventReport.ContainsKey(e.UserId))
                    {
                        _perUserEventReport[e.UserId].CountEvent((StEvent)e.Event, e.Id);
                    }
                    else
                    {
                        var report = new EventUserReport();
                        report.personId = e.UserId;
                        _perUserEventReport.Add(e.UserId, report);
                        report.CountEvent((StEvent)e.Event, e.Id);
                    }
                }
            }

            foreach (var e in PerUserEventReport)
            {
                e.person = _ctx.Person.FirstOrDefault(p0 => p0.Id == e.personId);
            }
        }
Ejemplo n.º 2
0
        private TreeViewItem GetUserSummary(List <ArgPointReport> reportsOfUser, EventUserReport eventUserReport)
        {
            var    res     = new TreeViewItem();
            string usrName = "";

            foreach (var apReport in reportsOfUser)
            {
                res.Items.Add(GetUserOneTopicSummary(apReport, false));
                if (apReport.user != null)
                {
                    usrName = apReport.user.Name;
                }
            }

            if (eventUserReport != null)
            {
                res.Items.Add(GetUserEventTotals(eventUserReport));
            }

            res.Header = "User summary for " + usrName;

            return(res);
        }
Ejemplo n.º 3
0
        private TreeViewItem GetUserSummary(List<ArgPointReport> reportsOfUser, EventUserReport eventUserReport)
        {
            var res = new TreeViewItem();
            string usrName = "";
            foreach (var apReport in reportsOfUser)
            {
                res.Items.Add(GetUserOneTopicSummary(apReport, false));
                if (apReport.user != null)
                    usrName = apReport.user.Name;
            }

            if (eventUserReport != null)
                res.Items.Add(GetUserEventTotals(eventUserReport));

            res.Header = "User summary for " + usrName;

            return res;
        }
Ejemplo n.º 4
0
        private TextBlock GetUserEventTotals(EventUserReport eTotals)
        {
            var sb = new StringBuilder();
            sb.AppendLine("<user event totals>");

            sb.Append("no. arg.point topic changed ");
            sb.AppendLine(eTotals.TotalArgPointTopicChanged.ToString());

            sb.Append("no. badge created ");
            sb.AppendLine(eTotals.TotalBadgeCreated.ToString());

            sb.Append("no. badge edited ");
            sb.AppendLine(eTotals.TotalBadgeEdited.ToString());

            sb.Append("no. badge moved ");
            sb.AppendLine(eTotals.TotalBadgeMoved.ToString());

            sb.Append("no. badge zoom in ");
            sb.AppendLine(eTotals.TotalBadgeZoomIn.ToString());

            sb.Append("no. cluster created ");
            sb.AppendLine(eTotals.TotalClusterCreated.ToString());

            sb.Append("no. cluster deleted ");
            sb.AppendLine(eTotals.TotalClusterDeleted.ToString());

            sb.Append("no. cluster-in ");
            sb.AppendLine(eTotals.TotalClusterIn.ToString());

            sb.Append("no. cluster moved ");
            sb.AppendLine(eTotals.TotalClusterMoved.ToString());

            sb.Append("no. cluster-out ");
            sb.AppendLine(eTotals.TotalClusterOut.ToString());

            sb.Append("no. cluster titles added ");
            sb.AppendLine(eTotals.TotalClusterTitlesAdded.ToString());

            sb.Append("no. cluster titles edited ");
            sb.AppendLine(eTotals.TotalClusterTitlesEdited.ToString());

            sb.Append("no. cluster titles removed ");
            sb.AppendLine(eTotals.TotalClusterTitlesRemoved.ToString());

            sb.Append("no. comment added ");
            sb.AppendLine(eTotals.TotalCommentAdded.ToString());

            sb.Append("no. comment removed ");
            sb.AppendLine(eTotals.TotalCommentRemoved.ToString());

            sb.Append("no. free drawing created ");
            sb.AppendLine(eTotals.TotalFreeDrawingCreated.ToString());

            sb.Append("no. free drawing moved ");
            sb.AppendLine(eTotals.TotalFreeDrawingMoved.ToString());

            sb.Append("no. free drawing removed ");
            sb.AppendLine(eTotals.TotalFreeDrawingRemoved.ToString());

            sb.Append("no. free drawing resize ");
            sb.AppendLine(eTotals.TotalFreeDrawingResize.ToString());

            sb.Append("no. image added ");
            sb.AppendLine(eTotals.TotalImageAdded.ToString());

            sb.Append("no. image opened ");
            sb.AppendLine(eTotals.TotalImageOpened.ToString());

            sb.Append("no. image url added ");
            sb.AppendLine(eTotals.TotalImageUrlAdded.ToString());

            sb.Append("no. link created ");
            sb.AppendLine(eTotals.TotalLinkCreated.ToString());

            sb.Append("no. link removed ");
            sb.AppendLine(eTotals.TotalLinkRemoved.ToString());

            sb.Append("no. media removed ");
            sb.AppendLine(eTotals.TotalMediaRemoved.ToString());

            sb.Append("no. PDF added ");
            sb.AppendLine(eTotals.TotalPdfAdded.ToString());

            sb.Append("no. PDF opened ");
            sb.AppendLine(eTotals.TotalPdfOpened.ToString());

            sb.Append("no. PDF url added ");
            sb.AppendLine(eTotals.TotalPdfUrlAdded.ToString());

            sb.Append("no. source added ");
            sb.AppendLine(eTotals.TotalSourceAdded.ToString());

            sb.Append("no. source opened ");
            sb.AppendLine(eTotals.TotalSourceOpened.ToString());

            sb.Append("no. source removed ");
            sb.AppendLine(eTotals.TotalSourceRemoved.ToString());

            sb.Append("no. video opened ");
            sb.AppendLine(eTotals.TotalVideoOpened.ToString());

            sb.Append("no. video added ");
            sb.AppendLine(eTotals.TotalYoutubeAdded.ToString());

            sb.Append("no. scene zoom in ");
            sb.AppendLine(eTotals.TotalSceneZoomedIn.ToString());

            sb.Append("no. scene zoom out ");
            sb.AppendLine(eTotals.TotalSceneZoomedOut.ToString());

            sb.Append("no. screenshot added ");
            sb.AppendLine(eTotals.TotalScreenshotAdded.ToString());

            sb.Append("no. screenshot opened ");
            sb.AppendLine(eTotals.TotalScreenshotOpened.ToString());

            sb.Append("no. laser enabled ");
            sb.AppendLine(eTotals.TotalLaserEnabled.ToString());

            return StatsUtils.WrapText(sb.ToString());
        }
Ejemplo n.º 5
0
        public void reportGenerated(ReportCollector sender, object args)
        {
            txtLastSync.Text = DateTime.Now.ToString();

            TreeViewItem topicsNode = null;
            TreeViewItem usersNode  = null;
            TreeViewItem eventsNode = null;

            if (args == leftReportTree)
            {
                _reportCollector1 = sender;
                topicsNode        = topicSection1;
                usersNode         = usersSection1;
                eventsNode        = eventSection1;
                reportHeader1.SetParticipants(sender.Participants);
            }
            else if (args == rightReportTree)
            {
                _reportCollector2 = sender;
                topicsNode        = topicSection2;
                usersNode         = usersSection2;
                eventsNode        = eventSection2;
                reportHeader2.SetParticipants(sender.Participants);
            }
            else
            {
                throw new NotSupportedException();
            }

            topicsNode.Items.Clear();
            foreach (var topicReport in sender.TopicReports)
            {
                topicsNode.Items.Add(GetTopicReport(topicReport, sender));
            }

            if (_reportCollector1 != null && _reportCollector2 != null)
            {
                var requiredUsers = StatsUtils.Union(reportHeader1.getReportParams(false).requiredUsers,
                                                     reportHeader2.getReportParams(false).requiredUsers);
                var totals = ReportCollector.GetTotalTopicsReports(_reportCollector1.TopicReports.First(),
                                                                   _reportCollector2.TopicReports.First(),
                                                                   requiredUsers);
                topicsNode.Items.Add(GetTotalTopicSummary(totals));
            }

            topicsNode.Items.Add(GetAttachmentsSummary(sender));

            topicsNode.Items.Add(StatsUtils.GetEventTotals(sender.EventTotals));

            usersNode.Items.Clear();
            foreach (var report in sender.ArgPointReports.Values)
            {
                EventUserReport eventReport = null;
                if (report.Count > 0)
                {
                    eventReport = sender.PerUserEventReportDict.ContainsKey(report.First().user.Id)
                                      ? sender.PerUserEventReportDict[report.First().user.Id]
                                      : null;
                }
                usersNode.Items.Add(GetUserSummary(report, eventReport));
            }

            eventsNode.Items.Clear();
            foreach (var ev in sender.StatsEvents)
            {
                eventsNode.Items.Add(GetEvent(ev, sender.GetCtx()));
            }
            usersNode.Items.Add(GetUserOneTopicSummary(sender.TotalArgPointReport, true));
        }
Ejemplo n.º 6
0
        private TextBlock GetUserEventTotals(EventUserReport eTotals)
        {
            var sb = new StringBuilder();

            sb.AppendLine("<user event totals>");

            sb.Append("no. arg.point topic changed ");
            sb.AppendLine(eTotals.TotalArgPointTopicChanged.ToString());

            sb.Append("no. badge created ");
            sb.AppendLine(eTotals.TotalBadgeCreated.ToString());

            sb.Append("no. badge edited ");
            sb.AppendLine(eTotals.TotalBadgeEdited.ToString());

            sb.Append("no. badge moved ");
            sb.AppendLine(eTotals.TotalBadgeMoved.ToString());

            sb.Append("no. badge zoom in ");
            sb.AppendLine(eTotals.TotalBadgeZoomIn.ToString());

            sb.Append("no. cluster created ");
            sb.AppendLine(eTotals.TotalClusterCreated.ToString());

            sb.Append("no. cluster deleted ");
            sb.AppendLine(eTotals.TotalClusterDeleted.ToString());

            sb.Append("no. cluster-in ");
            sb.AppendLine(eTotals.TotalClusterIn.ToString());

            sb.Append("no. cluster moved ");
            sb.AppendLine(eTotals.TotalClusterMoved.ToString());

            sb.Append("no. cluster-out ");
            sb.AppendLine(eTotals.TotalClusterOut.ToString());

            sb.Append("no. cluster titles added ");
            sb.AppendLine(eTotals.TotalClusterTitlesAdded.ToString());

            sb.Append("no. cluster titles edited ");
            sb.AppendLine(eTotals.TotalClusterTitlesEdited.ToString());

            sb.Append("no. cluster titles removed ");
            sb.AppendLine(eTotals.TotalClusterTitlesRemoved.ToString());

            sb.Append("no. comment added ");
            sb.AppendLine(eTotals.TotalCommentAdded.ToString());

            sb.Append("no. comment removed ");
            sb.AppendLine(eTotals.TotalCommentRemoved.ToString());

            sb.Append("no. free drawing created ");
            sb.AppendLine(eTotals.TotalFreeDrawingCreated.ToString());

            sb.Append("no. free drawing moved ");
            sb.AppendLine(eTotals.TotalFreeDrawingMoved.ToString());

            sb.Append("no. free drawing removed ");
            sb.AppendLine(eTotals.TotalFreeDrawingRemoved.ToString());

            sb.Append("no. free drawing resize ");
            sb.AppendLine(eTotals.TotalFreeDrawingResize.ToString());

            sb.Append("no. image added ");
            sb.AppendLine(eTotals.TotalImageAdded.ToString());

            sb.Append("no. image opened ");
            sb.AppendLine(eTotals.TotalImageOpened.ToString());

            sb.Append("no. image url added ");
            sb.AppendLine(eTotals.TotalImageUrlAdded.ToString());

            sb.Append("no. link created ");
            sb.AppendLine(eTotals.TotalLinkCreated.ToString());

            sb.Append("no. link removed ");
            sb.AppendLine(eTotals.TotalLinkRemoved.ToString());

            sb.Append("no. media removed ");
            sb.AppendLine(eTotals.TotalMediaRemoved.ToString());

            sb.Append("no. PDF added ");
            sb.AppendLine(eTotals.TotalPdfAdded.ToString());

            sb.Append("no. PDF opened ");
            sb.AppendLine(eTotals.TotalPdfOpened.ToString());

            sb.Append("no. PDF url added ");
            sb.AppendLine(eTotals.TotalPdfUrlAdded.ToString());

            sb.Append("no. source added ");
            sb.AppendLine(eTotals.TotalSourceAdded.ToString());

            sb.Append("no. source opened ");
            sb.AppendLine(eTotals.TotalSourceOpened.ToString());

            sb.Append("no. source removed ");
            sb.AppendLine(eTotals.TotalSourceRemoved.ToString());

            sb.Append("no. video opened ");
            sb.AppendLine(eTotals.TotalVideoOpened.ToString());

            sb.Append("no. video added ");
            sb.AppendLine(eTotals.TotalYoutubeAdded.ToString());

            sb.Append("no. scene zoom in ");
            sb.AppendLine(eTotals.TotalSceneZoomedIn.ToString());

            sb.Append("no. scene zoom out ");
            sb.AppendLine(eTotals.TotalSceneZoomedOut.ToString());

            sb.Append("no. screenshot added ");
            sb.AppendLine(eTotals.TotalScreenshotAdded.ToString());

            sb.Append("no. screenshot opened ");
            sb.AppendLine(eTotals.TotalScreenshotOpened.ToString());

            sb.Append("no. laser enabled ");
            sb.AppendLine(eTotals.TotalLaserEnabled.ToString());

            return(StatsUtils.WrapText(sb.ToString()));
        }
Ejemplo n.º 7
0
        private void prepareEvents()
        {
            foreach (var e in _ctx.StatsEvent)
            {
                if (e.TopicId != -1 && e.TopicId != _reportParams.topic.Id)
                    continue;

                if (e.UserId != -1 && !_reportParams.requiredUsers.Contains(e.UserId))
                    continue;

                StatsEvents.Add(e);
                EventTotals.CountEvent((StEvent) e.Event, e.Id);

                //count per user stats 
                if (e.UserId != -1)
                {
                    if (_perUserEventReport.ContainsKey(e.UserId))
                        _perUserEventReport[e.UserId].CountEvent((StEvent) e.Event, e.Id);
                    else
                    {
                        var report = new EventUserReport();
                        report.personId = e.UserId;
                        _perUserEventReport.Add(e.UserId, report);
                        report.CountEvent((StEvent) e.Event, e.Id);
                    }
                }
            }

            foreach (var e in PerUserEventReport)
            {
                e.person = _ctx.Person.FirstOrDefault(p0 => p0.Id == e.personId);
            }
        }