Example #1
0
        public void setInterventionsPerTeam()
        {
            foreach (Intervention i in Intervention.getActiveInterventionList())
            {
                foreach (Team team in i.getInterveningTeamList())
                {
                    if (i.getCode() == 1)
                    {
                        team.IncrementCode1();
                    }
                    if (i.getCode() == 2)
                    {
                        team.IncrementCode2();
                    }
                }
            }

            foreach (Intervention i in Intervention.getCompletedInterventionList())
            {
                foreach (Team team in i.getInterveningTeamList())
                {
                    if (i.getCode() == 1)
                    {
                        team.IncrementCode1();
                    }
                    if (i.getCode() == 2)
                    {
                        team.IncrementCode2();
                    }
                }
            }

            foreach (Team team in Team.getTeamList())
            {
                if (team.getCode1Count() != 0)
                {
                    Label lblCode1 = new Label();
                    lblCode1.Content = "Team " + team.getName() + " Code 1: ";
                    statisticsPage.LabelStackPanel.Children.Add(lblCode1);

                    Label infoLbl1 = new Label();
                    infoLbl1.Content = team.getCode1Count();
                    statisticsPage.InfoStackPanel.Children.Add(infoLbl1);
                }
                if (team.getCode2Count() != 0)
                {
                    Label lblCode2 = new Label();
                    lblCode2.Content = "Team " + team.getName() + " Code 2: ";
                    statisticsPage.LabelStackPanel.Children.Add(lblCode2);

                    Label infoLbl2 = new Label();
                    infoLbl2.Content = team.getCode2Count();
                    statisticsPage.InfoStackPanel.Children.Add(infoLbl2);
                }
                team.ResetCodeCount();
            }
        }
Example #2
0
        public void setAverageInterventionDuration()
        {
            List <TimeSpan> durationTimes = new List <TimeSpan>();

            foreach (Intervention i in Intervention.getCompletedInterventionList())
            {
                durationTimes.Add(i.getConclusionTime() - i.getFirstTeamArrivalTime());
            }
            try
            {
                double doubleAverageTicks = durationTimes.Average(timeSpan => timeSpan.Ticks);
                long   longAverageTicks   = Convert.ToInt64(doubleAverageTicks);

                this.averageDuration = new TimeSpan(longAverageTicks);
            }
            catch { }
        }
Example #3
0
 public void setNumberOfInterventions()
 {
     numberOfOngoingInterventions   = Intervention.getActiveInterventionList().Count;
     numberOfCompletedInterventions = Intervention.getCompletedInterventionList().Count;
 }