diff --git a/Alliance Optimizer.ipynb b/Alliance Optimizer.ipynb index 7955d78..f8033d5 100644 --- a/Alliance Optimizer.ipynb +++ b/Alliance Optimizer.ipynb @@ -1007,8 +1007,7 @@ "user_tz": 240 }, "id": "_GnvO48YhtE3", - "outputId": "5f166933-06ea-4067-9295-36166669b81e", - "scrolled": false + "outputId": "5f166933-06ea-4067-9295-36166669b81e" }, "outputs": [ { @@ -2071,9 +2070,9 @@ "provenance": [] }, "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "Python [conda env:base] *", "language": "python", - "name": "python3" + "name": "conda-base-py" }, "language_info": { "codemirror_mode": { @@ -2085,9 +2084,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.12" + "version": "3.13.9" } }, "nbformat": 4, - "nbformat_minor": 1 + "nbformat_minor": 4 } diff --git a/app/release/app-release.apk b/app/release/app-release.apk index 1872b60..1450116 100644 Binary files a/app/release/app-release.apk and b/app/release/app-release.apk differ diff --git a/app/release/baselineProfiles/0/app-release.dm b/app/release/baselineProfiles/0/app-release.dm index e6c352f..8fd2163 100644 Binary files a/app/release/baselineProfiles/0/app-release.dm and b/app/release/baselineProfiles/0/app-release.dm differ diff --git a/app/release/baselineProfiles/1/app-release.dm b/app/release/baselineProfiles/1/app-release.dm index 3c09e71..fdb1282 100644 Binary files a/app/release/baselineProfiles/1/app-release.dm and b/app/release/baselineProfiles/1/app-release.dm differ diff --git a/app/src/main/java/com/example/roboticsscoutingmatchapp/ActivityCompetitionSelection.java b/app/src/main/java/com/example/roboticsscoutingmatchapp/ActivityCompetitionSelection.java index 154c540..df07a7c 100644 --- a/app/src/main/java/com/example/roboticsscoutingmatchapp/ActivityCompetitionSelection.java +++ b/app/src/main/java/com/example/roboticsscoutingmatchapp/ActivityCompetitionSelection.java @@ -48,7 +48,6 @@ protected void onCreate(Bundle savedInstanceState) { Toast unfilledMessage = new Toast(this); unfilledMessage.setDuration(Toast.LENGTH_SHORT); - String scoutName; boolean changeCompetition = false; Bundle extras = getIntent().getExtras(); diff --git a/app/src/main/java/com/example/roboticsscoutingmatchapp/U.java b/app/src/main/java/com/example/roboticsscoutingmatchapp/U.java index 7c8480d..5cfb3e1 100644 --- a/app/src/main/java/com/example/roboticsscoutingmatchapp/U.java +++ b/app/src/main/java/com/example/roboticsscoutingmatchapp/U.java @@ -2,10 +2,12 @@ import android.util.Log; +import android.view.View; import android.widget.CheckBox; import android.widget.EditText; import android.widget.RadioGroup; import android.widget.RadioButton; +import android.widget.Spinner; import android.widget.TextView; import androidx.annotation.NonNull; @@ -153,7 +155,6 @@ public String nextCommaOn(String text, int commaNum){ if(commaNum <= 1){ return text.substring(text.indexOf(",")+1);} else{return nextCommaOn(text.substring(text.indexOf(",")+1), commaNum-1);} } - /** * Returns a copy of {@code text} from the beginning of {@code text} to the next comma.
* Pre-Condition: {@code text} must contain at least one comma. @@ -235,4 +236,8 @@ public int searchArrCol(ArrayList arr, int col, Object obj){ } return -1; } + + public String getSelectedItem(View options) { + return options.toString(); + } } diff --git a/app/src/main/java/com/example/roboticsscoutingmatchapp/activityAfterMatch.java b/app/src/main/java/com/example/roboticsscoutingmatchapp/activityAfterMatch.java index cbd2b4b..2f1d30f 100644 --- a/app/src/main/java/com/example/roboticsscoutingmatchapp/activityAfterMatch.java +++ b/app/src/main/java/com/example/roboticsscoutingmatchapp/activityAfterMatch.java @@ -39,8 +39,13 @@ protected void onCreate(Bundle savedInstanceState) { // *---Defines all the components on the current page as variables---* - CheckBox floorIntake = findViewById(R.id.floor_intake); - CheckBox humanPlayerStation = findViewById(R.id.human_player_intake); + CheckBox overBump = findViewById(R.id.over_bump); + CheckBox underTrench = findViewById(R.id.under_trench); + CheckBox playedDefense = findViewById(R.id.played_defense); + CheckBox collectedFuel = findViewById(R.id.collected_fuel); + CheckBox passedFuel = findViewById(R.id.passed_fuel); + CheckBox inactive = findViewById(R.id.inactive); + CheckBox other = findViewById(R.id.other); RadioGroup stopReasonGroup = findViewById(R.id.why_robot_stopped); RadioButton diedButton = findViewById(R.id.died); @@ -81,12 +86,20 @@ protected void onCreate(Bundle savedInstanceState) { } if(!postMatchSaveString.isEmpty()){ // Sets all the components to the values within the savestring - // Coral floor pickup able | Coral Source pickup able | Defense received | - // Stop reason | team rank among alliance | other comments questions or concerns || - floorIntake.setChecked(Boolean.parseBoolean(u.untilNextComma(postMatchSaveString))); // Sets the value to the parsed value in the savestring + overBump.setChecked(Boolean.parseBoolean(u.untilNextComma(postMatchSaveString))); // Sets the value to the parsed value in the savestring postMatchSaveString = u.nextCommaOn(postMatchSaveString); // removes the value from the savestring // So on an so forth - humanPlayerStation.setChecked(Boolean.parseBoolean(u.untilNextComma(postMatchSaveString))); + underTrench.setChecked(Boolean.parseBoolean(u.untilNextComma(postMatchSaveString))); + postMatchSaveString = u.nextCommaOn(postMatchSaveString); + playedDefense.setChecked(Boolean.parseBoolean(u.untilNextComma(postMatchSaveString))); + postMatchSaveString = u.nextCommaOn(postMatchSaveString); + collectedFuel.setChecked(Boolean.parseBoolean(u.untilNextComma(postMatchSaveString))); + postMatchSaveString = u.nextCommaOn(postMatchSaveString); + passedFuel.setChecked(Boolean.parseBoolean(u.untilNextComma(postMatchSaveString))); + postMatchSaveString = u.nextCommaOn(postMatchSaveString); + inactive.setChecked(Boolean.parseBoolean(u.untilNextComma(postMatchSaveString))); + postMatchSaveString = u.nextCommaOn(postMatchSaveString); + other.setChecked(Boolean.parseBoolean(u.untilNextComma(postMatchSaveString))); postMatchSaveString = u.nextCommaOn(postMatchSaveString); if(u.untilNextComma(postMatchSaveString).equals("No Defense")){ @@ -138,12 +151,15 @@ protected void onCreate(Bundle savedInstanceState) { backButton.setOnClickListener((l)->{ // Sets current savestring to current values of components // Because it's the back button, these values can have no value - // Coral floor pickup able | Coral Source pickup able | Defense received | - // Stop reason | team rank among alliance | other comments questions or concerns || String afterMatchInfo = ""; - afterMatchInfo += u.getData(floorIntake) + ","; - afterMatchInfo += u.getData(humanPlayerStation) + ","; + afterMatchInfo += u.getData(underTrench) + ","; + afterMatchInfo += u.getData(overBump) + ","; + afterMatchInfo += u.getData(playedDefense) + ","; + afterMatchInfo += u.getData(collectedFuel) + ","; + afterMatchInfo += u.getData(passedFuel) + ","; + afterMatchInfo += u.getData(inactive) + ","; + afterMatchInfo += u.getData(other) + ","; afterMatchInfo += u.getData(defenseReceivedGroup) + ","; afterMatchInfo += u.getData(stopReasonGroup) + ","; afterMatchInfo += u.getData(rankGroup) + ","; @@ -168,11 +184,14 @@ else if(u.getData(rankGroup).isEmpty()) else if(u.getData(stopReasonGroup).isEmpty()) response = "Please fill in stop reason"; else{ // If nothing is wrong, keep filling everything in - // Coral floor pickup able | Coral Source pickup able | Defense received | - // Stop reason | team rank among alliance | other comments questions or concerns || String postMatchInfo = ""; - postMatchInfo += u.getData(floorIntake) + ","; - postMatchInfo += u.getData(humanPlayerStation) + ","; + postMatchInfo += u.getData(overBump) + ","; + postMatchInfo += u.getData(underTrench) + ","; + postMatchInfo += u.getData(playedDefense) + ","; + postMatchInfo += u.getData(collectedFuel) + ","; + postMatchInfo += u.getData(passedFuel) + ","; + postMatchInfo += u.getData(inactive) + ","; + postMatchInfo += u.getData(other) + ","; postMatchInfo += u.getData(defenseReceivedGroup) + ","; postMatchInfo += u.getData(stopReasonGroup) + ","; postMatchInfo += u.getData(rankGroup) + ","; diff --git a/app/src/main/java/com/example/roboticsscoutingmatchapp/activityAutonomous.java b/app/src/main/java/com/example/roboticsscoutingmatchapp/activityAutonomous.java index c01f3f0..8c6c733 100644 --- a/app/src/main/java/com/example/roboticsscoutingmatchapp/activityAutonomous.java +++ b/app/src/main/java/com/example/roboticsscoutingmatchapp/activityAutonomous.java @@ -3,11 +3,15 @@ import android.content.Intent; import android.os.Bundle; import android.util.Log; +import android.view.View; +import android.widget.AdapterView; +import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.CheckBox; import android.widget.EditText; import android.widget.RadioButton; import android.widget.RadioGroup; +import android.widget.Spinner; import android.widget.Toast; import androidx.activity.EdgeToEdge; @@ -25,7 +29,6 @@ public void clearGroup(RadioGroup field1, RadioGroup field2){ } - @Override protected void onCreate(Bundle savedInstanceState) { @@ -57,79 +60,55 @@ protected void onCreate(Bundle savedInstanceState) { }); RadioGroup positionGroup1 = findViewById(R.id.staring_position_radio_group1); - RadioGroup positionGroup2 = findViewById(R.id.staring_position_radio_group2); RadioButton position1Button = findViewById(R.id.Position_1); RadioButton position2Button = findViewById(R.id.Position_2); RadioButton position3Button = findViewById(R.id.Position_3); - RadioButton position4Button = findViewById(R.id.position_4); - RadioButton position5Button = findViewById(R.id.position_5); - RadioButton position6Button = findViewById(R.id.position_6); - - CheckBox leftStarting = findViewById(R.id.left_starting_area); - - Button incrementAC1 = findViewById(R.id.up_count_button_ac1); - Button decrementAC1 = findViewById(R.id.down_count_button_ac1); - EditText AC1Field = findViewById(R.id.edit_text_ac1); - - Button incrementRC1 = findViewById(R.id.up_count_button_rc1); - Button decrementRC1 = findViewById(R.id.down_count_button_rc1); - EditText RC1Field = findViewById(R.id.edit_text_rc1); - - Button incrementAC2 = findViewById(R.id.up_count_button_ac2); - Button decrementAC2 = findViewById(R.id.down_count_button_ac2); - EditText AC2Field = findViewById(R.id.edit_text_ac2); - - Button incrementRC2 = findViewById(R.id.up_count_button_rc2); - Button decrementRC2 = findViewById(R.id.down_count_button_rc2); - EditText RC2Field = findViewById(R.id.edit_text_rc2); - - Button incrementAC3 = findViewById(R.id.up_count_button_ac3); - Button decrementAC3 = findViewById(R.id.down_count_button_ac3); - EditText AC3Field = findViewById(R.id.edit_text_ac3); - - Button incrementRC3 = findViewById(R.id.up_count_button_rc3); - Button decrementRC3 = findViewById(R.id.down_count_button_rc3); - EditText RC3Field = findViewById(R.id.edit_text_rc3); - - Button incrementAC4 = findViewById(R.id.up_count_button_ac4); - Button decrementAC4 = findViewById(R.id.down_count_button_ac4); - EditText AC4Field = findViewById(R.id.edit_text_ac4); - - Button incrementRC4 = findViewById(R.id.up_count_button_rc4); - Button decrementRC4 = findViewById(R.id.down_count_button_rc4); - EditText RC4Field = findViewById(R.id.edit_text_rc4); - - Button incrementBA = findViewById(R.id.up_count_button_ba); // BA = Barge attempted - Button decrementBA = findViewById(R.id.down_count_button_ba); - EditText BAField = findViewById(R.id.edit_text_ba); - - Button incrementBS = findViewById(R.id.up_count_button_bs); // BS = Barge scored - Button decrementBS = findViewById(R.id.down_count_button_bs); - EditText BSField = findViewById(R.id.edit_text_bs); - - Button incrementPA = findViewById(R.id.up_count_button_pa); // PA = Processor attempted - Button decrementPA = findViewById(R.id.down_count_button_pa); - EditText PAField = findViewById(R.id.edit_text_pa); - - Button incrementPS = findViewById(R.id.up_count_button_ps); - Button decrementPS = findViewById(R.id.down_count_button_ps); - EditText PSField = findViewById(R.id.edit_text_ps); - - Button incrementREA = findViewById(R.id.up_count_button_rea); // REA = Algae Removed - Button decrementREA = findViewById(R.id.down_count_button_rea); - EditText REAField = findViewById(R.id.edit_text_rea); + + Button FS1plus = findViewById(R.id.up_count_button_fs1); + Button FS5plus = findViewById(R.id.up_count_button_fs5); + Button FS10plus = findViewById(R.id.up_count_button_fs10); + Button FS15plus = findViewById(R.id.up_count_button_fs15); + Button FS20plus = findViewById(R.id.up_count_button_fs20); + + Button FS1minus = findViewById(R.id.down_count_button_fs1); + Button FS5minus = findViewById(R.id.down_count_button_fs5); + Button FS10minus = findViewById(R.id.down_count_button_fs10); + Button FS15minus = findViewById(R.id.down_count_button_fs15); + Button FS20minus = findViewById(R.id.down_count_button_fs20); + + Button FP1plus = findViewById(R.id.up_count_button_fp1); + Button FP5plus = findViewById(R.id.up_count_button_fp5); + Button FP10plus = findViewById(R.id.up_count_button_fp10); + Button FP15plus = findViewById(R.id.up_count_button_fp15); + Button FP20plus = findViewById(R.id.up_count_button_fp20); + + Button FP1minus = findViewById(R.id.down_count_button_fp1); + Button FP5minus = findViewById(R.id.down_count_button_fp5); + Button FP10minus = findViewById(R.id.down_count_button_fp10); + Button FP15minus = findViewById(R.id.down_count_button_fp15); + Button FP20minus = findViewById(R.id.down_count_button_fp20); + + EditText FSField = findViewById(R.id.edit_text_fs); + EditText FPField = findViewById(R.id.edit_text_fp); + + RadioGroup accuracyGroup = findViewById(R.id.accuracy_radio_group); + RadioButton lessThanTen = findViewById(R.id.underTen); + RadioButton twentyFivePercent = findViewById(R.id.twentyFivePercent); + RadioButton fiftyPercent = findViewById(R.id.fiftyPercent); + RadioButton seventyFivePercent = findViewById(R.id.seventyFivePercent); + RadioButton overNinetyFive = findViewById(R.id.overNinetyFive); Button backButton = findViewById(R.id.back_button); Button saveButton = findViewById(R.id.save_button); + CheckBox autoHang = findViewById(R.id.checkBox_auto_hang); + Toast unfilledMessage = new Toast(this); unfilledMessage.setDuration(Toast.LENGTH_SHORT); if(!autoSaveString.isEmpty()){ - // Starting Position | Left starting Position | #ACL1 | #ACL2 | #ACL3 | #ACL4 | - // #SCL1 | #SCL2 | #SCL3 | #SCL4 | #Barge attempted | #barge scored | - // #processor attempted | #processor scored |#algae removed || + // Starting Position | #Shots Fired | Accuracy % | #Fuel Passed | Auto Hang | String position = u.untilNextComma(autoSaveString); // Log.d(position, position); switch (position){ @@ -142,114 +121,67 @@ protected void onCreate(Bundle savedInstanceState) { case "Position 3": position3Button.toggle(); break; - case "Position 4": - position4Button.toggle(); + } + autoSaveString = u.nextCommaOn(autoSaveString); + + String accuracyChoice = u.untilNextComma(teleOpSaveString); + switch(accuracyChoice){ + case "Less Than 10%": + lessThanTen.toggle(); + break; + case "25%": + twentyFivePercent.toggle(); break; - case "Position 5": - position5Button.toggle(); + case "50%": + fiftyPercent.toggle(); break; - case "Position 6": - position6Button.toggle(); + case "75%": + seventyFivePercent.toggle(); + break; + case "More Than 95%": + overNinetyFive.toggle(); break; } - autoSaveString = u.nextCommaOn(autoSaveString); // Removes starting position - if(u.untilNextComma(autoSaveString).equals("True")) - leftStarting.toggle(); - autoSaveString = u.nextCommaOn(autoSaveString); // Removes left starting - AC1Field.setText(u.untilNextComma(autoSaveString)); - autoSaveString = u.nextCommaOn(autoSaveString); // Removes #ACL1 - AC2Field.setText(u.untilNextComma(autoSaveString)); - autoSaveString = u.nextCommaOn(autoSaveString); // Removes #ACL2 - AC3Field.setText(u.untilNextComma(autoSaveString)); - autoSaveString = u.nextCommaOn(autoSaveString); // Remove #ACL3 - AC4Field.setText(u.untilNextComma(autoSaveString)); - autoSaveString = u.nextCommaOn(autoSaveString); // Remove #ACL4 - RC1Field.setText(u.untilNextComma(autoSaveString)); - autoSaveString = u.nextCommaOn(autoSaveString); // Remove #SCL1 - RC2Field.setText(u.untilNextComma(autoSaveString)); - autoSaveString = u.nextCommaOn(autoSaveString); // Remove #SCL2 - RC3Field.setText(u.untilNextComma(autoSaveString)); - autoSaveString = u.nextCommaOn(autoSaveString); // Remove #SCL3 - RC4Field.setText(u.untilNextComma(autoSaveString)); - autoSaveString = u.nextCommaOn(autoSaveString); // Remove #SCL4 - BAField.setText(u.untilNextComma(autoSaveString)); - autoSaveString = u.nextCommaOn(autoSaveString); // Remove Attempted Barge - BSField.setText(u.untilNextComma(autoSaveString)); - autoSaveString = u.nextCommaOn(autoSaveString); // Remove Scored Barge - PAField.setText(u.untilNextComma(autoSaveString)); - autoSaveString = u.nextCommaOn(autoSaveString); // Remove Attempted Processor - PSField.setText(u.untilNextComma(autoSaveString)); - autoSaveString = u.nextCommaOn(autoSaveString); // Remove Scored Processor - REAField.setText(u.untilNextComma(autoSaveString)); - autoSaveString = u.nextCommaOn(autoSaveString); // Remove Algae removed - } + autoSaveString = u.nextCommaOn(autoSaveString); + FSField.setText(u.untilNextComma(autoSaveString)); + autoSaveString = u.nextCommaOn(autoSaveString); + } - - positionGroup1.setOnCheckedChangeListener((l, w)->clearGroup(positionGroup2, positionGroup1)); - positionGroup2.setOnCheckedChangeListener((l, w)->clearGroup(positionGroup1, positionGroup2)); - + FS1plus.setOnClickListener((l)->u.incrementText(FSField)); + FS1minus.setOnClickListener((l)->u.incrementText(FSField, -1)); + FS5plus.setOnClickListener((l)->u.incrementText(FSField, +5)); + FS5minus.setOnClickListener((l)->u.incrementText(FSField, -5)); + FS10plus.setOnClickListener((l)->u.incrementText(FSField, +10)); + FS10minus.setOnClickListener((l)->u.incrementText(FSField, -10)); + FS15plus.setOnClickListener((l)->u.incrementText(FSField, +15)); + FS15minus.setOnClickListener((l)->u.incrementText(FSField, -15)); + FS20plus.setOnClickListener((l)->u.incrementText(FSField, +20)); + FS20minus.setOnClickListener((l)->u.incrementText(FSField, -20)); + + FP1plus.setOnClickListener((l)->u.incrementText(FPField)); + FP1minus.setOnClickListener((l)->u.incrementText(FPField, -1)); + FP5plus.setOnClickListener((l)->u.incrementText(FPField, +5)); + FP5minus.setOnClickListener((l)->u.incrementText(FPField, -5)); + FP10plus.setOnClickListener((l)->u.incrementText(FPField, +10)); + FP10minus.setOnClickListener((l)->u.incrementText(FPField, -10)); + FP15plus.setOnClickListener((l)->u.incrementText(FPField, +15)); + FP15minus.setOnClickListener((l)->u.incrementText(FPField, -15)); + FP20plus.setOnClickListener((l)->u.incrementText(FPField, +20)); + FP20minus.setOnClickListener((l)->u.incrementText(FPField, -20)); // Sets all the buttons to either increment or decrement their respective buttons. - // Can be simplified. Not now. - incrementAC1.setOnClickListener((l)->u.incrementText(AC1Field)); - decrementAC1.setOnClickListener((l)->u.incrementText(AC1Field, -1)); - incrementRC1.setOnClickListener((l)->u.incrementText(RC1Field)); - decrementRC1.setOnClickListener((l)->u.incrementText(RC1Field, -1)); - incrementAC2.setOnClickListener((l)->u.incrementText(AC2Field)); - decrementAC2.setOnClickListener((l)->u.incrementText(AC2Field, -1)); - incrementRC2.setOnClickListener((l)->u.incrementText(RC2Field)); - decrementRC2.setOnClickListener((l)->u.incrementText(RC2Field, -1)); - incrementAC3.setOnClickListener((l)->u.incrementText(AC3Field)); - decrementAC3.setOnClickListener((l)->u.incrementText(AC3Field, -1)); - incrementRC3.setOnClickListener((l)->u.incrementText(RC3Field)); - decrementRC3.setOnClickListener((l)->u.incrementText(RC3Field, -1)); - incrementAC4.setOnClickListener((l)->u.incrementText(AC4Field)); - decrementAC4.setOnClickListener((l)->u.incrementText(AC4Field, -1)); - incrementRC4.setOnClickListener((l)->u.incrementText(RC4Field)); - decrementRC4.setOnClickListener((l)->u.incrementText(RC4Field, -1)); - incrementBA.setOnClickListener((l)->u.incrementText(BAField)); - decrementBA.setOnClickListener((l)->u.incrementText(BAField, -1)); - incrementBS.setOnClickListener((l)->u.incrementText(BSField)); - decrementBS.setOnClickListener((l)->u.incrementText(BSField, -1)); - incrementPA.setOnClickListener((l)->u.incrementText(PAField)); - decrementPA.setOnClickListener((l)->u.incrementText(PAField, -1)); - incrementPS.setOnClickListener((l)->u.incrementText(PSField)); - decrementPS.setOnClickListener((l)->u.incrementText(PSField, -1)); - incrementREA.setOnClickListener((l)->u.incrementText(REAField)); - decrementREA.setOnClickListener((l)->u.incrementText(REAField, -1)); backButton.setOnClickListener((l)-> { - // Starting Position | Left starting Position | #ACL1 | #ACL2 | #ACL3 | #ACL4 | - // #SCL1 | #SCL2 | #SCL3 | #SCL4 | #Barge attempted | #barge scored | - // #processor attempted | #processor scored |#algae removed || + // Starting Position | #Shots Fired | Accuracy % | #Fuel Passed | Auto Hang | String autoInfo = ""; + autoInfo += u.getData(positionGroup1); - if (!u.getData(positionGroup1).isEmpty() || !u.getData(positionGroup2).isEmpty()) { - if (u.getData(positionGroup1).isEmpty()) { - autoInfo += u.getData(positionGroup2); - } else { - autoInfo += u.getData(positionGroup1); - } - } - autoInfo += ","; // Starting position # end - autoInfo += u.getData(leftStarting) + ","; // Left starting end + autoInfo += u.getData(FSField); + autoInfo += u.getData(accuracyGroup); - autoInfo += u.getData(AC1Field) + ","; - autoInfo += u.getData(AC2Field) + ","; - autoInfo += u.getData(AC3Field) + ","; - autoInfo += u.getData(AC4Field) + ","; // Attempted Coral end - - autoInfo += u.getData(RC1Field) + ","; - autoInfo += u.getData(RC2Field) + ","; - autoInfo += u.getData(RC3Field) + ","; - autoInfo += u.getData(RC4Field) + ","; // Scored Coral End - - autoInfo += u.getData(BAField) + ","; - autoInfo += u.getData(BSField) + ","; - autoInfo += u.getData(PAField) + ","; - autoInfo += u.getData(PSField) + ","; - autoInfo += u.getData(REAField) + ","; // Algae end + autoInfo += u.getData(FPField); + autoInfo += u.getData(autoHang); Intent i = new Intent(this, activityPreMatch.class); i.putExtra("preMatch", preMatchSaveString); i.putExtra("auto", autoInfo); @@ -262,87 +194,23 @@ protected void onCreate(Bundle savedInstanceState) { saveButton.setOnClickListener((l)-> { String response = ""; - if(u.getData(AC1Field).isEmpty()) { - AC1Field.setText("0"); - } - if(u.getData(RC1Field).isEmpty()) { - RC1Field.setText("0"); - } - if(u.getData(AC2Field).isEmpty()) { - AC2Field.setText("0"); - } - if(u.getData(RC2Field).isEmpty()) { - RC2Field.setText("0"); - } - if(u.getData(AC3Field).isEmpty()) { - AC3Field.setText("0"); - } - if(u.getData(RC3Field).isEmpty()) { - RC3Field.setText("0"); - } - if(u.getData(AC4Field).isEmpty()) { - AC4Field.setText("0"); - } - if(u.getData(RC4Field).isEmpty()) { - RC4Field.setText("0"); - } - if(u.getData(BAField).isEmpty()) { - BAField.setText("0"); - } - if(u.getData(BSField).isEmpty()) { - BSField.setText("0"); - } - if(u.getData(PAField).isEmpty()) { - PAField.setText("0"); - } - if(u.getData(PSField).isEmpty()) { - PSField.setText("0"); - } - if(u.getData(REAField).isEmpty()) { - REAField.setText("0"); - } - if((u.getData(positionGroup1).isEmpty()) && (u.getData(positionGroup2).isEmpty())) + + if((u.getData(positionGroup1).isEmpty())) response = "Please fill position"; - else if(Integer.parseInt(u.getData(AC1Field)) < Integer.parseInt(u.getData(RC1Field))) - response = "Attempted Coral L1 cannot be less than Scored Coral L1"; - else if(Integer.parseInt(u.getData(AC2Field)) < Integer.parseInt(u.getData(RC2Field))) - response = "Attempted Coral L2 cannot be less than Scored Coral L2"; - else if(Integer.parseInt(u.getData(AC3Field)) < Integer.parseInt(u.getData(RC3Field))) - response = "Attempted Coral L3 cannot be less than Scored Coral L3"; - else if(Integer.parseInt(u.getData(AC4Field)) < Integer.parseInt(u.getData(RC4Field))) - response = "Attempted Coral L4 cannot be less than Scored Coral L4"; - else if(Integer.parseInt(u.getData(BAField)) < Integer.parseInt(u.getData(BSField))) - response = "Attempted Barge cannot be less than Scored Barge"; - else if(Integer.parseInt(u.getData(PAField)) < Integer.parseInt(u.getData(PSField))) - response = "Attempted Processor cannot be less than Scored Processor"; + if ((u.getData(accuracyGroup).isEmpty())) + response = "Please give accuracy"; else{ String autoInfo = ""; + autoInfo += u.getData(positionGroup1) + ","; + + autoInfo += u.getData(FSField) + ","; + autoInfo += u.getData(accuracyGroup) + ","; + + autoInfo += u.getData(FPField) + ","; - if (u.getData(positionGroup1).isEmpty()) { - autoInfo += u.getData(positionGroup2); - } else { - autoInfo += u.getData(positionGroup1); - } - autoInfo += ","; // Starting position # end - autoInfo += u.getData(leftStarting) + ","; // Left starting end - - autoInfo += u.getData(AC1Field) + ","; - autoInfo += u.getData(AC2Field) + ","; - autoInfo += u.getData(AC3Field) + ","; - autoInfo += u.getData(AC4Field) + ","; // Attempted Coral end - - autoInfo += u.getData(RC1Field) + ","; - autoInfo += u.getData(RC2Field) + ","; - autoInfo += u.getData(RC3Field) + ","; - autoInfo += u.getData(RC4Field) + ","; // Scored Coral End - - autoInfo += u.getData(BAField) + ","; - autoInfo += u.getData(BSField) + ","; - autoInfo += u.getData(PAField) + ","; - autoInfo += u.getData(PSField) + ","; - autoInfo += u.getData(REAField) + ","; // Algae end + autoInfo += u.getData(autoHang) + ","; Intent i = new Intent(this, activityTeleOp.class); i.putExtra("preMatch", preMatchSaveString); diff --git a/app/src/main/java/com/example/roboticsscoutingmatchapp/activityPreMatch.java b/app/src/main/java/com/example/roboticsscoutingmatchapp/activityPreMatch.java index 428bd6e..c54e3b5 100644 --- a/app/src/main/java/com/example/roboticsscoutingmatchapp/activityPreMatch.java +++ b/app/src/main/java/com/example/roboticsscoutingmatchapp/activityPreMatch.java @@ -60,8 +60,8 @@ protected void onCreate(Bundle savedInstanceState) { EditText matchNumber = findViewById(R.id.match_number); EditText teamNumber = findViewById(R.id.team_number); RadioGroup teamColorRadioGroup = findViewById(R.id.team_color_radio_group); + CheckBox preloadedFuel = findViewById(R.id.checkBox_preloaded_fuel); Button saveButton = findViewById(R.id.save_button); - CheckBox preloadedCoral = findViewById(R.id.checkBox_preloaded_coral); Button backButton = findViewById(R.id.back_button); if(!scoutNameString.isEmpty()){ scoutName.setText(scoutNameString); @@ -83,7 +83,7 @@ protected void onCreate(Bundle savedInstanceState) { preMatchSaveString = u.nextCommaOn(preMatchSaveString); // remove team color matchNumber.setText(u.untilNextComma(preMatchSaveString)); preMatchSaveString = u.nextCommaOn(preMatchSaveString); // remove match number - preloadedCoral.setChecked(Boolean.parseBoolean(u.untilNextComma(preMatchSaveString))); + preloadedFuel.setChecked(Boolean.parseBoolean(u.untilNextComma(preMatchSaveString))); preMatchSaveString = u.nextCommaOn(preMatchSaveString); // Remove Checked } @@ -116,7 +116,7 @@ protected void onCreate(Bundle savedInstanceState) { preMatchInfo += u.stripText(u.getData(teamNumber)) + ","; preMatchInfo += u.stripText(u.getData(teamColorRadioGroup)) + ","; preMatchInfo += u.stripText(u.getData(matchNumber)) + ","; - preMatchInfo += u.stripText(u.getData(preloadedCoral)) + ","; + preMatchInfo += u.stripText(u.getData(preloadedFuel)) + ","; i.putExtra("preMatch", preMatchInfo); i.putExtra("auto", autoSaveString); diff --git a/app/src/main/java/com/example/roboticsscoutingmatchapp/activityTeleOp.java b/app/src/main/java/com/example/roboticsscoutingmatchapp/activityTeleOp.java index be7d3c3..58383ab 100644 --- a/app/src/main/java/com/example/roboticsscoutingmatchapp/activityTeleOp.java +++ b/app/src/main/java/com/example/roboticsscoutingmatchapp/activityTeleOp.java @@ -3,7 +3,6 @@ import android.content.Intent; import android.os.Bundle; import android.widget.Button; -import android.widget.CheckBox; import android.widget.EditText; import android.widget.RadioButton; import android.widget.RadioGroup; @@ -48,101 +47,83 @@ protected void onCreate(Bundle savedInstanceState) { // Defining all the access-necessary components within the page Button backButton = findViewById(R.id.back_button); Button saveButton = findViewById(R.id.save_button); - Button AC1plus = findViewById(R.id.up_count_button_ac1); // Attempted Coral L1 - Button AC1minus = findViewById(R.id.down_count_button_ac1); - EditText AC1field = findViewById(R.id.edit_text_ac1); - Button RC1plus = findViewById(R.id.up_count_button_rc1); // Scored Coral L1 - Button RC1minus = findViewById(R.id.down_count_button_rc1); - EditText RC1field = findViewById(R.id.edit_text_rc1); - Button AC2plus = findViewById(R.id.up_count_button_ac2); // Attempted Coral L2 - Button AC2minus = findViewById(R.id.down_count_button_ac2); - EditText AC2field = findViewById(R.id.edit_text_ac2); - Button RC2plus = findViewById(R.id.up_count_button_rc2); // Scored Coral L2 - Button RC2minus = findViewById(R.id.down_count_button_rc2); - EditText RC2field = findViewById(R.id.edit_text_rc2); - Button AC3plus = findViewById(R.id.up_count_button_ac3); // Attempted Coral L3 - Button AC3minus = findViewById(R.id.down_count_button_ac3); - EditText AC3field = findViewById(R.id.edit_text_ac3); - Button RC3plus = findViewById(R.id.up_count_button_rc3); // Scored Coral L3 - Button RC3minus = findViewById(R.id.down_count_button_rc3); - EditText RC3field = findViewById(R.id.edit_text_rc3); - Button AC4plus = findViewById(R.id.up_count_button_ac4); // Attempted Coral L4 - Button AC4minus = findViewById(R.id.down_count_button_ac4); - EditText AC4field = findViewById(R.id.edit_text_ac4); - Button RC4plus = findViewById(R.id.up_count_button_rc4); // Scored Coral L4 - Button RC4minus = findViewById(R.id.down_count_button_rc4); - EditText RC4field = findViewById(R.id.edit_text_rc4); - Button APplus = findViewById(R.id.up_count_button_pa); // Attempted Processor - Button APminus = findViewById(R.id.down_count_button_pa); - EditText APfield = findViewById(R.id.edit_text_pa); - Button SPplus = findViewById(R.id.up_count_button_ps); // Scored Processor - Button SPminus = findViewById(R.id.down_count_button_ps); - EditText SPfield = findViewById(R.id.edit_text_ps); - Button ABplus = findViewById(R.id.up_count_button_ba); // Attempted Barge - Button ABminus = findViewById(R.id.down_count_button_ba); - EditText ABfield = findViewById(R.id.edit_text_ba); - Button SBplus = findViewById(R.id.up_count_button_bs); // Scored Barge - Button SBminus = findViewById(R.id.down_count_button_bs); - EditText SBfield = findViewById(R.id.edit_text_bs); - RadioGroup parkRadioGroup = findViewById(R.id.endgame_location); // Endgame RadioGroup - RadioButton hangShallowButton = findViewById(R.id.hang_shallow); - RadioButton hangDeepButton = findViewById(R.id.hang_deep); - RadioButton parkButton = findViewById(R.id.park); + + EditText FSField = findViewById(R.id.edit_text_fs); + + Button FS1plus = findViewById(R.id.up_count_button_fs1); + Button FS5plus = findViewById(R.id.up_count_button_fs5); + Button FS10plus = findViewById(R.id.up_count_button_fs10); + Button FS15plus = findViewById(R.id.up_count_button_fs15); + Button FS20plus = findViewById(R.id.up_count_button_fs20); + + Button FS1minus = findViewById(R.id.down_count_button_fs1); + Button FS5minus = findViewById(R.id.down_count_button_fs5); + Button FS10minus = findViewById(R.id.down_count_button_fs10); + Button FS15minus = findViewById(R.id.down_count_button_fs15); + Button FS20minus = findViewById(R.id.down_count_button_fs20); + + RadioGroup accuracyGroup = findViewById(R.id.accuracy_radio_group); + RadioButton lessThanTen = findViewById(R.id.underTen); + RadioButton twentyFivePercent = findViewById(R.id.twentyFivePercent); + RadioButton fiftyPercent = findViewById(R.id.fiftyPercent); + RadioButton seventyFivePercent = findViewById(R.id.seventyFivePercent); + RadioButton overNinetyFive = findViewById(R.id.overNinetyFive); + + EditText FPField = findViewById(R.id.edit_text_fp); + + Button FP1plus = findViewById(R.id.up_count_button_fp1); + Button FP5plus = findViewById(R.id.up_count_button_fp5); + Button FP10plus = findViewById(R.id.up_count_button_fp10); + Button FP15plus = findViewById(R.id.up_count_button_fp15); + Button FP20plus = findViewById(R.id.up_count_button_fp20); + + Button FP1minus = findViewById(R.id.down_count_button_fp1); + Button FP5minus = findViewById(R.id.down_count_button_fp5); + Button FP10minus = findViewById(R.id.down_count_button_fp10); + Button FP15minus = findViewById(R.id.down_count_button_fp15); + Button FP20minus = findViewById(R.id.down_count_button_fp20); + + RadioGroup parkRadioGroup = findViewById(R.id.endgame_location); + RadioButton level1Button = findViewById(R.id.level1_climb); + RadioButton level2Button = findViewById(R.id.level2_climb); + RadioButton level3Button = findViewById(R.id.level3_climb); + + RadioGroup accuracyRadioGroup = findViewById(R.id.accuracy_position); + RadioButton pacManButton = findViewById(R.id.pac_manning); + RadioButton standStillButton = findViewById(R.id.stand_still); + RadioButton noDifferenceButton = findViewById(R.id.no_difference); + RadioButton badAccuracyButton = findViewById(R.id.bad_accuracy); + RadioButton noneButton = findViewById(R.id.nothing); RadioGroup endgameTimeGroup = findViewById(R.id.endgame_time); RadioButton twentyFiveButton = findViewById(R.id.twenty_five); RadioButton twentyButton = findViewById(R.id.twenty); RadioButton fifteenButton = findViewById(R.id.fifteen); RadioButton tenButton = findViewById(R.id.ten); + RadioButton fiveButton = findViewById(R.id.five); RadioButton zeroButton = findViewById(R.id.zero); - CheckBox algaeBox = findViewById(R.id.pickup_algae); - CheckBox coralBox = findViewById(R.id.pickup_coral); Toast unfilledMessage = new Toast(this); unfilledMessage.setDuration(Toast.LENGTH_SHORT); // Setting all fields which have data if(!teleOpSaveString.isEmpty()){ - // #ACL1 | #ACL2 | #ACL3 | #ACL4 | # SCL1 | #SCL2 | #SCL3 | #SCL4 | - // #Attempted processor | #Scored Processor | #Attempted Barge | #Scored Barge | - // Park/Shallow/Deep | Time to hang | Algae Pickup | Coral Pickup || - AC1field.setText(u.untilNextComma(teleOpSaveString)); - teleOpSaveString = u.nextCommaOn(teleOpSaveString); - AC2field.setText(u.untilNextComma(teleOpSaveString)); - teleOpSaveString = u.nextCommaOn(teleOpSaveString); - AC3field.setText(u.untilNextComma(teleOpSaveString)); - teleOpSaveString = u.nextCommaOn(teleOpSaveString); - AC4field.setText(u.untilNextComma(teleOpSaveString)); - teleOpSaveString = u.nextCommaOn(teleOpSaveString); - - RC1field.setText(u.untilNextComma(teleOpSaveString)); - teleOpSaveString = u.nextCommaOn(teleOpSaveString); - RC2field.setText(u.untilNextComma(teleOpSaveString)); - teleOpSaveString = u.nextCommaOn(teleOpSaveString); - RC3field.setText(u.untilNextComma(teleOpSaveString)); + // #Fuel Shot | Accuracy % | #Fuel Passed | Hang Status | Hang Time | Accuracy Position | + FSField.setText(u.untilNextComma(teleOpSaveString)); teleOpSaveString = u.nextCommaOn(teleOpSaveString); - RC4field.setText(u.untilNextComma(teleOpSaveString)); + FPField.setText(u.untilNextComma(teleOpSaveString)); teleOpSaveString = u.nextCommaOn(teleOpSaveString); - APfield.setText(u.untilNextComma(teleOpSaveString)); - teleOpSaveString = u.nextCommaOn(teleOpSaveString); - SPfield.setText(u.untilNextComma(teleOpSaveString)); - teleOpSaveString = u.nextCommaOn(teleOpSaveString); - ABfield.setText(u.untilNextComma(teleOpSaveString)); - teleOpSaveString = u.nextCommaOn(teleOpSaveString); - SBfield.setText(u.untilNextComma(teleOpSaveString)); - teleOpSaveString = u.nextCommaOn(teleOpSaveString); - String currentButton = u.untilNextComma(teleOpSaveString); switch(currentButton){ - case "Hang Shallow": - hangShallowButton.toggle(); + case "Level 1": + level1Button.toggle(); break; - case "Hang Deep": - hangDeepButton.toggle(); + case "Level 2": + level2Button.toggle(); break; - case "Park": - parkButton.toggle(); + case "Level 3": + level3Button.toggle(); break; case "None": noneButton.toggle(); @@ -164,77 +145,93 @@ protected void onCreate(Bundle savedInstanceState) { case "10": tenButton.toggle(); break; + case "5": + fiveButton.toggle(); + break; case "0": zeroButton.toggle(); break; } teleOpSaveString = u.nextCommaOn(teleOpSaveString); - algaeBox.setChecked(Boolean.parseBoolean(u.untilNextComma(teleOpSaveString))); - teleOpSaveString = u.nextCommaOn(teleOpSaveString); - coralBox.setChecked(Boolean.parseBoolean(u.untilNextComma(teleOpSaveString))); + String accuracyPosition = u.untilNextComma(teleOpSaveString); + switch(accuracyPosition){ + case "When moving": + pacManButton.toggle(); + break; + case "When unmoving": + standStillButton.toggle(); + break; + case "About the same": + noDifferenceButton.toggle(); + break; + case "Consistently bad accuracy": + badAccuracyButton.toggle(); + break; + } teleOpSaveString = u.nextCommaOn(teleOpSaveString); - } - - // Setting increment and decrement listeners for all buttons - AC1plus.setOnClickListener((l)->u.incrementText(AC1field)); - AC1minus.setOnClickListener((l)->u.incrementText(AC1field, -1)); - RC1plus.setOnClickListener((l)->u.incrementText(RC1field)); - RC1minus.setOnClickListener((l)->u.incrementText(RC1field, -1)); - AC2plus.setOnClickListener((l)->u.incrementText(AC2field)); - AC2minus.setOnClickListener((l)->u.incrementText(AC2field, -1)); - RC2plus.setOnClickListener((l)->u.incrementText(RC2field)); - RC2minus.setOnClickListener((l)->u.incrementText(RC2field, -1)); + String accuracyChoice = u.untilNextComma(teleOpSaveString); + switch(accuracyChoice){ + case "Less Than 10%": + lessThanTen.toggle(); + break; + case "25%": + twentyFivePercent.toggle(); + break; + case "50%": + fiftyPercent.toggle(); + break; + case "75%": + seventyFivePercent.toggle(); + break; + case "More Than 95%": + overNinetyFive.toggle(); + break; + } - AC3plus.setOnClickListener((l)->u.incrementText(AC3field)); - AC3minus.setOnClickListener((l)->u.incrementText(AC3field, -1)); - RC3plus.setOnClickListener((l)->u.incrementText(RC3field)); - RC3minus.setOnClickListener((l)->u.incrementText(RC3field, -1)); - AC4plus.setOnClickListener((l)->u.incrementText(AC4field)); - AC4minus.setOnClickListener((l)->u.incrementText(AC4field, -1)); - RC4plus.setOnClickListener((l)->u.incrementText(RC4field)); - RC4minus.setOnClickListener((l)->u.incrementText(RC4field, -1)); + teleOpSaveString = u.nextCommaOn(teleOpSaveString); - APplus.setOnClickListener((l)->u.incrementText(APfield)); - APminus.setOnClickListener((l)->u.incrementText(APfield, -1)); - SPplus.setOnClickListener((l)->u.incrementText(SPfield)); - SPminus.setOnClickListener((l)->u.incrementText(SPfield, -1)); + } - ABplus.setOnClickListener((l)->u.incrementText(ABfield)); - ABminus.setOnClickListener((l)->u.incrementText(ABfield, -1)); - SBplus.setOnClickListener((l)->u.incrementText(SBfield)); - SBminus.setOnClickListener((l)->u.incrementText(SBfield, -1)); + // Setting increment and decrement listeners for all buttons + FS1plus.setOnClickListener((l)->u.incrementText(FSField)); + FS1minus.setOnClickListener((l)->u.incrementText(FSField, -1)); + FS5plus.setOnClickListener((l)->u.incrementText(FSField, +5)); + FS5minus.setOnClickListener((l)->u.incrementText(FSField, -5)); + FS10plus.setOnClickListener((l)->u.incrementText(FSField, +10)); + FS10minus.setOnClickListener((l)->u.incrementText(FSField, -10)); + FS15plus.setOnClickListener((l)->u.incrementText(FSField, +15)); + FS15minus.setOnClickListener((l)->u.incrementText(FSField, -15)); + FS20plus.setOnClickListener((l)->u.incrementText(FSField, +20)); + FS20minus.setOnClickListener((l)->u.incrementText(FSField, -20)); + + FP1plus.setOnClickListener((l)->u.incrementText(FPField)); + FP1minus.setOnClickListener((l)->u.incrementText(FPField, -1)); + FP5plus.setOnClickListener((l)->u.incrementText(FPField, +5)); + FP5minus.setOnClickListener((l)->u.incrementText(FPField, -5)); + FP10plus.setOnClickListener((l)->u.incrementText(FPField, +10)); + FP10minus.setOnClickListener((l)->u.incrementText(FPField, -10)); + FP15plus.setOnClickListener((l)->u.incrementText(FPField, +15)); + FP15minus.setOnClickListener((l)->u.incrementText(FPField, -15)); + FP20plus.setOnClickListener((l)->u.incrementText(FPField, +20)); + FP20minus.setOnClickListener((l)->u.incrementText(FPField, -20)); // Back button, which sends data backwards even if it's unfilled backButton.setOnClickListener((l)->{ String teleOpInfo = ""; - // #ACL1 | #ACL2 | #ACL3 | #ACL4 | # SCL1 | #SCL2 | #SCL3 | #SCL4 | - // #Attempted processor | #Scored Processor | #Attempted Barge | #Scored Barge | - // Park/Shallow/Deep | Time to hang | Algae Pickup | Coral Pickup || + // #Fuel Shot | Accuracy % | #Fuel Passed | Hang Status | Hang Time | Accuracy Position | - teleOpInfo += u.getData(AC1field) + ","; - teleOpInfo += u.getData(AC2field) + ","; - teleOpInfo += u.getData(AC3field) + ","; - teleOpInfo += u.getData(AC4field) + ","; // Attempted Done + teleOpInfo += u.getData(FSField) + ","; + teleOpInfo += u.getData(accuracyGroup) + ","; - teleOpInfo += u.getData(RC1field) + ","; - teleOpInfo += u.getData(RC2field) + ","; - teleOpInfo += u.getData(RC3field) + ","; - teleOpInfo += u.getData(RC4field) + ","; // Scored Done - - teleOpInfo += u.getData(APfield) + ","; - teleOpInfo += u.getData(SPfield) + ","; - teleOpInfo += u.getData(ABfield) + ","; - teleOpInfo += u.getData(SBfield) + ","; // Algae Done + teleOpInfo += u.getData(FPField) + ","; teleOpInfo += u.getData(parkRadioGroup) + ","; teleOpInfo += u.getData(endgameTimeGroup) + ","; - - teleOpInfo += u.getData(algaeBox) + ","; - teleOpInfo += u.getData(coralBox) + ","; + teleOpInfo += u.getData(accuracyRadioGroup) + ","; Intent i = new Intent(this, activityAutonomous.class); i.putExtra("preMatch", preMatchSaveString); @@ -247,69 +244,29 @@ protected void onCreate(Bundle savedInstanceState) { saveButton.setOnClickListener((l) -> { String response = ""; - if (u.getData(AC1field).isEmpty()) - AC1field.setText("0"); - if(u.getData(RC1field).isEmpty()) - RC1field.setText("0"); - if(u.getData(AC2field).isEmpty()) - AC2field.setText("0"); - if(u.getData(RC2field).isEmpty()) - RC2field.setText("0"); - if(u.getData(AC3field).isEmpty()) - AC3field.setText("0"); - if(u.getData(RC3field).isEmpty()) - RC3field.setText("0"); - if(u.getData(AC4field).isEmpty()) - AC4field.setText("0"); - if(u.getData(RC4field).isEmpty()) - RC4field.setText("0"); - if(u.getData(APfield).isEmpty()) - APfield.setText("0"); - if(u.getData(SPfield).isEmpty()) - SPfield.setText("0"); - if(u.getData(ABfield).isEmpty()) - ABfield.setText("0"); - if(u.getData(SBfield).isEmpty()) - SBfield.setText("0"); + if (u.getData(FSField).isEmpty()) + FSField.setText("0"); + if(u.getData(FPField).isEmpty()) + FPField.setText("0"); + if ((u.getData(accuracyGroup).isEmpty())) + response = "Please give accuracy"; + if ((u.getData(accuracyRadioGroup).isEmpty())) + response = "Please give accuracy position"; if(u.getData(parkRadioGroup).isEmpty()) response = "Please select an endgame position"; else if(u.getData(endgameTimeGroup).isEmpty()) response = "Please select park time"; - else if(Integer.parseInt(u.getData(AC1field)) < Integer.parseInt(u.getData(RC1field))) - response = "Attempted Coral L1 cannot be less than Scored Coral L1"; - else if(Integer.parseInt(u.getData(AC2field)) < Integer.parseInt(u.getData(RC2field))) - response = "Attempted Coral L2 cannot be less than Scored Coral L2"; - else if(Integer.parseInt(u.getData(AC3field)) < Integer.parseInt(u.getData(RC3field))) - response = "Attempted Coral L3 cannot be less than Scored Coral L3"; - else if(Integer.parseInt(u.getData(AC4field)) < Integer.parseInt(u.getData(RC4field))) - response = "Attempted Coral L4 cannot be less than Scored Coral L4"; - else if(Integer.parseInt(u.getData(APfield)) < Integer.parseInt(u.getData(SPfield))) - response = "Attempted Processor cannot be less than Scored Processor"; - else if(Integer.parseInt(u.getData(ABfield)) < Integer.parseInt(u.getData(SBfield))) - response = "Attempted Barge cannot be less than Scored Barge"; else{ String teleOpInfo = ""; - teleOpInfo += u.getData(AC1field) + ","; - teleOpInfo += u.getData(AC2field) + ","; - teleOpInfo += u.getData(AC3field) + ","; - teleOpInfo += u.getData(AC4field) + ","; // Attempted Done + teleOpInfo += u.getData(FSField) + ","; + teleOpInfo += u.getData(accuracyGroup) + ","; - teleOpInfo += u.getData(RC1field) + ","; - teleOpInfo += u.getData(RC2field) + ","; - teleOpInfo += u.getData(RC3field) + ","; - teleOpInfo += u.getData(RC4field) + ","; // Scored Done - - teleOpInfo += u.getData(APfield) + ","; - teleOpInfo += u.getData(SPfield) + ","; - teleOpInfo += u.getData(ABfield) + ","; - teleOpInfo += u.getData(SBfield) + ","; // Algae Done + teleOpInfo += u.getData(FPField) + ","; teleOpInfo += u.getData(parkRadioGroup) + ","; teleOpInfo += u.getData(endgameTimeGroup) + ","; - - teleOpInfo += u.getData(algaeBox) + ","; - teleOpInfo += u.getData(coralBox) + ","; + teleOpInfo += u.getData(accuracyRadioGroup) + ","; Intent i = new Intent(this, activityAfterMatch.class); i.putExtra("preMatch", preMatchSaveString); diff --git a/app/src/main/res/drawable/rebuilt_starting_positions.png b/app/src/main/res/drawable/rebuilt_starting_positions.png new file mode 100644 index 0000000..b9d1f50 Binary files /dev/null and b/app/src/main/res/drawable/rebuilt_starting_positions.png differ diff --git a/app/src/main/res/drawable/rebuilt_starting_positions_better.png b/app/src/main/res/drawable/rebuilt_starting_positions_better.png new file mode 100644 index 0000000..bf43624 Binary files /dev/null and b/app/src/main/res/drawable/rebuilt_starting_positions_better.png differ diff --git a/app/src/main/res/layout/activity_after_match.xml b/app/src/main/res/layout/activity_after_match.xml index 798a131..5bcba50 100644 --- a/app/src/main/res/layout/activity_after_match.xml +++ b/app/src/main/res/layout/activity_after_match.xml @@ -37,7 +37,7 @@ android:paddingHorizontal="20dp" > - + @@ -57,18 +58,65 @@ android:orientation="horizontal"> + android:text="@string/bump"/> + + + + + + + + + + + + + + + + android:text="@string/endText" + android:textColor="@color/black"/> diff --git a/app/src/main/res/layout/activity_autonomous.xml b/app/src/main/res/layout/activity_autonomous.xml index 4014839..0fae577 100644 --- a/app/src/main/res/layout/activity_autonomous.xml +++ b/app/src/main/res/layout/activity_autonomous.xml @@ -40,7 +40,7 @@ android:id="@+id/imageView" android:layout_width="401dp" android:layout_height="159dp" - app:srcCompat="@drawable/starting_positions" /> + app:srcCompat="@drawable/rebuilt_starting_positions_better" /> - - - - - - - - - - - - - - - - - - + android:text="@string/scoring"/> - - -