Example #1
0
        void initializeMatchData()
        {
            initializeRowHeaders();
            for (int j = 0; j < 12; j++)
            {
                for (int k = 0; k < 3; k++)
                {
                    gridData[j, k] = new DataCell();
                }
            }

            int y = 0;

            // Add data headers
            cHeaderCells[0]             = new ColumnHeaderCell();
            cHeaderCells[0].header.Text = "Successes";
            matchDataGrid.Children.Add(cHeaderCells[0], 1, 3);
            cHeaderCells[1]             = new ColumnHeaderCell();
            cHeaderCells[1].header.Text = "Attempts";
            matchDataGrid.Children.Add(cHeaderCells[1], 2, 3);
            cHeaderCells[2]             = new ColumnHeaderCell();
            cHeaderCells[2].header.Text = "Drops";
            matchDataGrid.Children.Add(cHeaderCells[2], 3, 3);

            cHeaderCells[3]             = new ColumnHeaderCell();
            cHeaderCells[3].header.Text = "Avg.";
            matchDataGrid.Children.Add(cHeaderCells[3], 1, 6);

            cHeaderCells[4]             = new ColumnHeaderCell();
            cHeaderCells[4].header.Text = "High";
            matchDataGrid.Children.Add(cHeaderCells[4], 2, 6);

            cHeaderCells[5]             = new ColumnHeaderCell();
            cHeaderCells[5].header.Text = "Avg.";
            matchDataGrid.Children.Add(cHeaderCells[5], 1, 9);
            cHeaderCells[6]             = new ColumnHeaderCell();
            cHeaderCells[6].header.Text = "High";
            matchDataGrid.Children.Add(cHeaderCells[6], 2, 9);

            cHeaderCells[7]             = new ColumnHeaderCell();
            cHeaderCells[7].header.Text = "Successes";
            matchDataGrid.Children.Add(cHeaderCells[7], 1, 15);
            cHeaderCells[8]             = new ColumnHeaderCell();
            cHeaderCells[8].header.Text = "Attempts";
            matchDataGrid.Children.Add(cHeaderCells[8], 2, 15);

            // Add Data
            gridData[0, 0].data.Text = data.matchCount.ToString();
            matchDataGrid.Children.Add(gridData[0, 0], 1, y++);
            gridData[1, 0].data.Text = data.maxFuelCapacity.ToString();
            matchDataGrid.Children.Add(gridData[1, 0], 1, y++);
            y++;
            y++;
            gridData[2, 0].data.Text = data.totalAutoCrossSuccesses.ToString();
            matchDataGrid.Children.Add(gridData[2, 0], 1, y++);
            gridData[3, 0].data.Text = data.avgAutoGearScored.ToString();
            matchDataGrid.Children.Add(gridData[3, 0], 1, y);
            gridData[3, 1].data.Text = data.avgAutoGearsDelivered.ToString();
            matchDataGrid.Children.Add(gridData[3, 1], 2, y);
            gridData[3, 2].data.Text = data.avgAutoGearsDropped.ToString();
            matchDataGrid.Children.Add(gridData[3, 2], 3, y++);
            y++;
            gridData[4, 0].data.Text = data.avgAutoPressure.ToString();
            matchDataGrid.Children.Add(gridData[4, 0], 1, y);
            gridData[4, 1].data.Text = data.autoPressureHigh.ToString();
            matchDataGrid.Children.Add(gridData[4, 1], 1 + 1, y++);
            y++;
            y++;
            gridData[5, 0].data.Text = data.avgTeleOpActions.ToString();
            matchDataGrid.Children.Add(gridData[5, 0], 1, y);
            gridData[5, 1].data.Text = data.teleOpActionsHigh.ToString();
            matchDataGrid.Children.Add(gridData[5, 1], 2, y++);
            gridData[6, 0].data.Text = data.avgTeleOpGearsScored.ToString();
            matchDataGrid.Children.Add(gridData[6, 0], 1, y);
            gridData[6, 1].data.Text = data.teleOpGearsScoredHigh.ToString();
            matchDataGrid.Children.Add(gridData[6, 1], 2, y++);
            gridData[7, 0].data.Text = data.avgTeleOpGearsStationDropped.ToString();
            matchDataGrid.Children.Add(gridData[7, 0], 1, y);
            gridData[7, 1].data.Text = data.teleOpGearsStationDroppedHigh.ToString();
            matchDataGrid.Children.Add(gridData[7, 1], 2, y++);
            gridData[8, 0].data.Text = data.avgTeleOpGearsTransitDropped.ToString();
            matchDataGrid.Children.Add(gridData[8, 0], 1, y);
            gridData[8, 1].data.Text = data.teleOpGearsTransitDroppedHigh.ToString();
            matchDataGrid.Children.Add(gridData[8, 1], 2, y++);
            gridData[9, 0].data.Text = data.avgTeleOpPressure.ToString();
            matchDataGrid.Children.Add(gridData[9, 0], 1, y);
            gridData[9, 1].data.Text = data.teleOpPressureHigh.ToString();
            matchDataGrid.Children.Add(gridData[9, 1], 2, y++);
            y++;
            gridData[10, 0].data.Text = data.successfulClimbCount.ToString();
            matchDataGrid.Children.Add(gridData[10, 0], 1, y);
            gridData[10, 1].data.Text = data.attemptedClimbCount.ToString();
            matchDataGrid.Children.Add(gridData[10, 1], 2, y++);
            gridData[11, 0].data.Text = data.foulCount.ToString();
            matchDataGrid.Children.Add(gridData[11, 0], 1, y++);
        }
Example #2
0
        async Task initializeTeamData(int i)
        {
            while (semaphore[i] == false)
            {
            }

            try {
                for (int j = 0; j < 12; j++)
                {
                    for (int k = 0; k < 3; k++)
                    {
                        gridData[i, j, k] = new DataCell();
                        if (i < 3)
                        {
                            gridData[i, j, k].BackgroundColor = Color.Red;
                        }
                        else
                        {
                            gridData[i, j, k].BackgroundColor = Color.Blue;
                        }
                    }
                }
                int y = 0;

                teamDataGrid[i] = new Grid()
                {
                    BackgroundColor = Color.Black,
                    ColumnSpacing   = 1,
                    RowSpacing      = 1,
                    RowDefinitions  = rowHeaderGrid.RowDefinitions
                };
                // Add data headers
                cHeaderCells[i, 0]             = new ColumnHeaderCell();
                cHeaderCells[i, 0].header.Text = "Successes";
                teamDataGrid[i].Children.Add(cHeaderCells[i, 0], 0, 3);
                cHeaderCells[i, 1]             = new ColumnHeaderCell();
                cHeaderCells[i, 1].header.Text = "Attempts";
                teamDataGrid[i].Children.Add(cHeaderCells[i, 1], 1, 3);
                cHeaderCells[i, 2]             = new ColumnHeaderCell();
                cHeaderCells[i, 2].header.Text = "Drops";
                teamDataGrid[i].Children.Add(cHeaderCells[i, 2], 2, 3);

                cHeaderCells[i, 3]             = new ColumnHeaderCell();
                cHeaderCells[i, 3].header.Text = "Avg.";
                teamDataGrid[i].Children.Add(cHeaderCells[i, 3], 0, 6);

                cHeaderCells[i, 4]             = new ColumnHeaderCell();
                cHeaderCells[i, 4].header.Text = "High";
                teamDataGrid[i].Children.Add(cHeaderCells[i, 4], 1, 6);

                cHeaderCells[i, 5]             = new ColumnHeaderCell();
                cHeaderCells[i, 5].header.Text = "Avg.";
                teamDataGrid[i].Children.Add(cHeaderCells[i, 5], 0, 9);
                cHeaderCells[i, 6]             = new ColumnHeaderCell();
                cHeaderCells[i, 6].header.Text = "High";
                teamDataGrid[i].Children.Add(cHeaderCells[i, 6], 1, 9);

                cHeaderCells[i, 7]             = new ColumnHeaderCell();
                cHeaderCells[i, 7].header.Text = "Successes";
                teamDataGrid[i].Children.Add(cHeaderCells[i, 7], 0, 15);
                cHeaderCells[i, 8]             = new ColumnHeaderCell();
                cHeaderCells[i, 8].header.Text = "Attempts";
                teamDataGrid[i].Children.Add(cHeaderCells[i, 8], 1, 15);

                // Add Data
                gridData[i, 0, 0].data.Text = teams[i].matchCount.ToString();
                teamDataGrid[i].Children.Add(gridData[i, 0, 0], 0, y++);
                gridData[i, 1, 0].data.Text = teams[i].maxFuelCapacity.ToString();
                teamDataGrid[i].Children.Add(gridData[i, 1, 0], 0, y++);
                y++;
                y++;
                gridData[i, 2, 0].data.Text = teams[i].totalAutoCrossSuccesses.ToString();
                teamDataGrid[i].Children.Add(gridData[i, 2, 0], 0, y++);
                gridData[i, 3, 0].data.Text = String.Format("{0:N2}", teams[i].avgAutoGearScored);
                teamDataGrid[i].Children.Add(gridData[i, 3, 0], 0, y);
                gridData[i, 3, 1].data.Text = String.Format("{0:N2}", teams[i].avgAutoGearsDelivered);
                teamDataGrid[i].Children.Add(gridData[i, 3, 1], 1, y);
                gridData[i, 3, 2].data.Text = String.Format("{0:N2}", teams[i].avgAutoGearsDropped);
                teamDataGrid[i].Children.Add(gridData[i, 3, 2], 2, y++);
                y++;
                gridData[i, 4, 0].data.Text = String.Format("{0:N2}", teams[i].avgAutoPressure);
                teamDataGrid[i].Children.Add(gridData[i, 4, 0], 0, y);
                gridData[i, 4, 1].data.Text = teams[i].autoPressureHigh.ToString();
                teamDataGrid[i].Children.Add(gridData[i, 4, 1], 1, y++);
                y++;
                y++;
                gridData[i, 5, 0].data.Text = String.Format("{0:N2}", teams[i].avgTeleOpActions);
                teamDataGrid[i].Children.Add(gridData[i, 5, 0], 0, y);
                gridData[i, 5, 1].data.Text = teams[i].teleOpActionsHigh.ToString();
                teamDataGrid[i].Children.Add(gridData[i, 5, 1], 1, y++);
                gridData[i, 6, 0].data.Text = String.Format("{0:N2}", teams[i].avgTeleOpGearsScored);
                teamDataGrid[i].Children.Add(gridData[i, 6, 0], 0, y);
                gridData[i, 6, 1].data.Text = teams[i].teleOpGearsScoredHigh.ToString();
                teamDataGrid[i].Children.Add(gridData[i, 6, 1], 1, y++);
                gridData[i, 7, 0].data.Text = String.Format("{0:N2}", teams[i].avgTeleOpGearsStationDropped);
                teamDataGrid[i].Children.Add(gridData[i, 7, 0], 0, y);
                gridData[i, 7, 1].data.Text = teams[i].teleOpGearsStationDroppedHigh.ToString();
                teamDataGrid[i].Children.Add(gridData[i, 7, 1], 1, y++);
                gridData[i, 8, 0].data.Text = String.Format("{0:N2}", teams[i].avgTeleOpGearsTransitDropped);
                teamDataGrid[i].Children.Add(gridData[i, 8, 0], 0, y);
                gridData[i, 8, 1].data.Text = teams[i].teleOpGearsTransitDroppedHigh.ToString();
                teamDataGrid[i].Children.Add(gridData[i, 8, 1], 1, y++);
                gridData[i, 9, 0].data.Text = String.Format("{0:N2}", teams[i].avgTeleOpPressure);
                teamDataGrid[i].Children.Add(gridData[i, 9, 0], 0, y);
                gridData[i, 9, 1].data.Text = teams[i].teleOpPressureHigh.ToString();
                teamDataGrid[i].Children.Add(gridData[i, 9, 1], 1, y++);
                y++;
                gridData[i, 10, 0].data.Text = teams[i].successfulClimbCount.ToString();
                teamDataGrid[i].Children.Add(gridData[i, 10, 0], 0, y);
                gridData[i, 10, 1].data.Text = teams[i].attemptedClimbCount.ToString();
                teamDataGrid[i].Children.Add(gridData[i, 10, 1], 1, y++);
                gridData[i, 11, 0].data.Text = teams[i].foulCount.ToString();
                teamDataGrid[i].Children.Add(gridData[i, 11, 0], 0, y++);

                teamDataView[i].Content = teamDataGrid[i];
            } catch (Exception ex) {
                Console.WriteLine("initializeTeamData Error: " + ex.Message);
            }
        }