public AutoMatchScoutingPage(MatchData data, int matchType) { matchData = data; mType = matchType; Title = "Autonomous Mode"; Label teamNumberLbl = new Label() { HorizontalOptions = LayoutOptions.StartAndExpand, Text = "Team: " + matchData.teamNumber.ToString(), TextColor = Color.White, BackgroundColor = Color.Green, FontSize = GlobalVariables.sizeSmall, FontAttributes = FontAttributes.Bold }; autoPressureLbl = new Label() { HorizontalOptions = LayoutOptions.CenterAndExpand, Text = "Total Pressure: 0", TextColor = Color.White, BackgroundColor = Color.Green, FontSize = GlobalVariables.sizeSmall, FontAttributes = FontAttributes.Bold }; autoGearLbl = new Label() { HorizontalOptions = LayoutOptions.EndAndExpand, Text = "Total Gears: 0", TextColor = Color.White, BackgroundColor = Color.Green, FontSize = GlobalVariables.sizeSmall, FontAttributes = FontAttributes.Bold }; inputs[0] = new TitledColorButton("Crossing", "CROSSED"); inputs[1] = new TitledColorButton("Gears", "Gear Scored"); inputs[1].PropertyChanged += (sender, e) => { autoGearLbl.Text = "Total Gears: " + (inputs[1].getBtnStatus() ? 1 : 0); }; pressureCounter = new MultiCounter("Pressure"); pressureCounter.PropertyChanged += (sender, e) => { autoPressureLbl.Text = "Total Pressure: " + pressureCounter.getValue(); }; var teleOpBtn = new Button() { Text = "TELEOP", FontAttributes = FontAttributes.Bold, HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand, FontSize = GlobalVariables.sizeTitle, BackgroundColor = Color.Yellow }; teleOpBtn.Clicked += (sender, e) => { saveData(); Navigation.PushModalAsync(new TeleOpMatchScoutingPage(matchData, mType)); }; var topBar = new StackLayout() { HorizontalOptions = LayoutOptions.FillAndExpand, Orientation = StackOrientation.Horizontal, BackgroundColor = Color.Green, Spacing = 0, }; topBar.Children.Add(teamNumberLbl); topBar.Children.Add(autoPressureLbl); topBar.Children.Add(autoGearLbl); pageLayout.Children.Add(inputs[0], 0, 0); pageLayout.Children.Add(pressureCounter, 1, 2, 0, 2); pageLayout.Children.Add(inputs[1], 2, 0); pageLayout.Children.Add(teleOpBtn, 1, 2, 3, 4); BackgroundColor = Color.Teal; Content = new StackLayout() { HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand, //Spacing = 0, Children = { topBar, new ScrollView() { HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand, IsClippedToBounds = true, Content = pageLayout } } }; }
public PostMatchScoutingPage(MatchData data, int matchType) { Title = "Post Match"; matchData = data; mType = matchType; Label teamNumberLbl = new Label() { HorizontalOptions = LayoutOptions.StartAndExpand, Text = "Team: " + matchData.teamNumber.ToString(), TextColor = Color.White, BackgroundColor = Color.Green, FontSize = GlobalVariables.sizeSmall, FontAttributes = FontAttributes.Bold }; pressureLbl = new Label() { HorizontalOptions = LayoutOptions.CenterAndExpand, Text = "Pressure: " + (matchData.autoPressure + matchData.teleOpPressure), TextColor = Color.White, BackgroundColor = Color.Green, FontSize = GlobalVariables.sizeSmall, FontAttributes = FontAttributes.Bold }; gearLbl = new Label() { HorizontalOptions = LayoutOptions.EndAndExpand, Text = "Gears: " + ((matchData.autoGearScored ? 1 : 0) + matchData.teleOpGearsScored), TextColor = Color.White, BackgroundColor = Color.Green, FontSize = GlobalVariables.sizeSmall, FontAttributes = FontAttributes.Bold }; climbSuccessBtn = new TitledColorButton("Climbing", "Success"); goodCheck = new CheckBox() { DefaultText = "Did this team perform well?", FontSize = GlobalVariables.sizeSmall }; fullDisableBtn = new TitledColorButton("Full Disable", "Disabled"); partialDisablesCounter = new SingleCounter("Partial Disables"); foulCounter = new SingleCounter("Fouls"); var foulNotesLbl = new Label() { HorizontalOptions = LayoutOptions.CenterAndExpand, Text = "Foul Notes", TextColor = Color.Black, FontSize = GlobalVariables.sizeMedium, FontAttributes = FontAttributes.Bold }; foulNotes = new Editor() { HorizontalOptions = LayoutOptions.FillAndExpand, BackgroundColor = Color.Gray }; pilotErrorBtn = new TitledColorButton("Pilot Error", "Error"); var finishMatchBtn = new Button() { Text = "Save Match Data", FontSize = GlobalVariables.sizeMedium, BackgroundColor = Color.Green, }; finishMatchBtn.Clicked += (sender, e) => { finishMatch(); }; var topBar = new StackLayout() { HorizontalOptions = LayoutOptions.FillAndExpand, Orientation = StackOrientation.Horizontal, BackgroundColor = Color.Green, Spacing = 0, }; topBar.Children.Add(teamNumberLbl); topBar.Children.Add(pressureLbl); topBar.Children.Add(gearLbl); pageLayout.Children.Add(climbSuccessBtn, 0, 0); pageLayout.Children.Add(pilotErrorBtn, 0, 1); pageLayout.Children.Add(goodCheck, 0, 2); pageLayout.Children.Add(fullDisableBtn, 1, 0); pageLayout.Children.Add(partialDisablesCounter, 1, 1); pageLayout.Children.Add(foulCounter, 2, 0); pageLayout.Children.Add(foulNotesLbl, 2, 1); pageLayout.Children.Add(foulNotes, 2, 3, 1, 4); pageLayout.Children.Add(finishMatchBtn, 1, 2, 5, 6); Content = new StackLayout() { HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand, Spacing = 0, Children = { topBar, new ScrollView() { HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand, IsClippedToBounds = true, Content = pageLayout } } }; }