mirror of
https://github.com/Team4388/RidgeScout.git
synced 2026-06-09 08:38:03 -06:00
Compare commits
6 Commits
v1.0
...
Fix-CSV-Export
| Author | SHA1 | Date | |
|---|---|---|---|
| a15deda539 | |||
| 0846f5a3b3 | |||
| 554cad2abd | |||
| 7d41a5e5a9 | |||
| 4cb20f4769 | |||
| 6b4b919e5f |
@@ -25,7 +25,6 @@
|
||||
- A page that lets scouters more easily make reports to the drive team before a match starts (Report)
|
||||
|
||||
#### Things that may or may not be implemented:
|
||||
- Practice mode
|
||||
- Statbotics intgration
|
||||
- Scout error estimation using OPR-like calculation
|
||||
- - Would most likely require Statbotics
|
||||
|
||||
@@ -25,8 +25,8 @@ android {
|
||||
applicationId = "com.ridgebotics.ridgescout"
|
||||
minSdk = 24
|
||||
targetSdk = 34
|
||||
versionCode = 7 // **IMPORTANT** Increment this before releasing on github
|
||||
versionName = "1.0"// **IMPORTANT** Change this before releasing on github (<Year num since 2024>.<Update Version>)
|
||||
versionCode = 9 // **IMPORTANT** Increment this before releasing on github
|
||||
versionName = "1.2"// **IMPORTANT** Change this before releasing on github (<Year num since 2024>.<Update Version>)
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
@@ -24,23 +24,34 @@ public class fields {
|
||||
public static final inputType[][] default_match_fields = new inputType[][] {
|
||||
{
|
||||
new fieldposType("Auto start pos", "Where does the robot start its auto?", new int[]{0,0}),
|
||||
new tallyType("Auto Coral", "How many coral did this robot score in auto?", 0),
|
||||
new tallyType("Auto Algae", "How many algae did this robot score in auto?", 0),
|
||||
new sliderType("Auto Performance", "How well did you think this robot did in auto?", 5, 0, 10),
|
||||
|
||||
new tallyType("Auto L4 Coral", "How many coral did this robot score in L4 during auto?", 0),
|
||||
new tallyType("Auto L3 Coral", "How many coral did this robot score in L3 during auto?", 0),
|
||||
new tallyType("Auto L2 Coral", "How many coral did this robot score in L2 during auto?", 0),
|
||||
new tallyType("Auto L1/Trough Coral", "How many coral did this robot score in L1 during auto?", 0),
|
||||
new tallyType("Auto Processor Algae", "How many algae did this robot score in the Barge during auto?", 0),
|
||||
new tallyType("Auto Barge Algae", "How many algae did this robot score in the Barge during auto?", 0),
|
||||
|
||||
new dropdownType("Auto Quality", "How did the robot drive during auto?", new String[]{"Smooth", "Jittery"}, 0),
|
||||
new textType("Auto Comments", "Anything interesting about auto", ""),
|
||||
new tallyType("Teleop Coral", "How many coral did this robot score in teleop?", 0),
|
||||
new tallyType("Teleop Algae", "How many algae did this robot score in teleop?", 0),
|
||||
new checkboxType("Coral Removal", "Did the robot remove coral?", 0),
|
||||
new checkboxType("L4 Scoring", "Did the robot score in Layer 4?", 0),
|
||||
new checkboxType("L3 Scoring", "Did the robot score in Layer 3?", 0),
|
||||
new checkboxType("L2 Scoring", "Did the robot score in Layer 3?", 0),
|
||||
new checkboxType("L1 Scoring", "Did the robot score in Layer 1?", 0),
|
||||
new checkboxType("Processor Scoring", "Did the robot score in the processor?", 0),
|
||||
new checkboxType("Net Scoring", "Did the robot score in the net?", 0),
|
||||
new sliderType("Teleop Performance", "How well did the robot drive around?", 5, 0, 10),
|
||||
new textType("Teleop Notes", "Anything intresting about Teleop", ""),
|
||||
new dropdownType("End Condition", "What was the final condition of the robot?", new String[]{"Nothing", "Park", "Attempted Shallow", "Shallow", "Attempted Deep", "Deep"}, 0),
|
||||
new dropdownType("Robot Condition", "Was anything broken?", new String[]{"Everything was working", "Something was maybe broken", "Something was broken", "Robot was disabled for part of the match", "Missing robot (Joe Johnson)"}, 0),
|
||||
|
||||
new tallyType("Teleop L4 Coral", "How many coral did this robot score in L4 during auto?", 0),
|
||||
new tallyType("Teleop L3 Coral", "How many coral did this robot score in L3 during auto?", 0),
|
||||
new tallyType("Teleop L2 Coral", "How many coral did this robot score in L2 during auto?", 0),
|
||||
new tallyType("Teleop L1 Coral", "How many coral did this robot score in L1 during auto?", 0),
|
||||
new tallyType("Teleop Processor Algae", "How many algae did this robot score in the Barge during auto?", 0),
|
||||
new tallyType("Teleop Barge Algae", "How many algae did this robot score in the Barge during auto?", 0),
|
||||
|
||||
new checkboxType("Upper Algae Removal", "Did the robot remove upper Algae?", 0),
|
||||
new checkboxType("Lower Algae Removal", "Did the robot remove lower Algae?", 0),
|
||||
|
||||
new dropdownType("Teleop Quality", "How did the robot drive during Teleop?", new String[]{"Smooth", "Jittery"}, 0),
|
||||
new textType("Teleop Comments", "Anything interesting about Teleop", ""),
|
||||
|
||||
new dropdownType("Climb State", "What was the final condition of the robot?", new String[]{"Nothing", "Continued Cycling", "Park", "Attempted Shallow", "Shallow", "Attempted Deep", "Deep"}, 0),
|
||||
|
||||
new dropdownType("Robot Condition", "Was anything broken?", new String[]{"Everything was working", "Something was maybe broken", "Something was broken", "Robot was disabled for part of the match", "Missing robot"}, 0),
|
||||
|
||||
new textType("Other Comments", "Any other comments you have", "")
|
||||
}
|
||||
};
|
||||
@@ -48,16 +59,24 @@ public class fields {
|
||||
public static final inputType[][] default_pit_fields = new inputType[][] {
|
||||
{
|
||||
new dropdownType("Drivetrain type", "What type of drivetrain does this team have?", new String[]{"Swerve Drive", "Tank Drive (Differential)", "Other, Info in comments"}, 0),
|
||||
new dropdownType("Intake type", "What type of intake does this team have?", new String[]{"Swerve Drive", "Tank Drive (Differential)", "Other, Info in comments"}, 0),
|
||||
|
||||
new dropdownType("Score Area", "What does this robot score?", new String[]{"Only Algae", "Mostly Algae", "Both", "Mostly Coral", "Only Coral"}, 0),
|
||||
|
||||
new checkboxType("L4 Scoring", "Will the robot score in Layer 4?", 0),
|
||||
new checkboxType("L3 Scoring", "Will the robot score in Layer 3?", 0),
|
||||
new checkboxType("L2 Scoring", "Will the robot score in Layer 3?", 0),
|
||||
new checkboxType("L1/Trough Scoring", "Will the robot score in Layer 1?", 0),
|
||||
new checkboxType("Processor Scoring", "Will the robot score in the processor?", 0),
|
||||
new checkboxType("Net Scoring", "Will the robot score algae in the net?", 0),
|
||||
new sliderType("Specialization", "How specified is the robot to it's scoring area?", 5, 0, 10),
|
||||
new sliderType("Scoring Consistency", "How consistent is the robot at scoring?", 5, 0, 10),
|
||||
new checkboxType("Barge Scoring", "Will the robot score algae in the Barge?", 0),
|
||||
new dropdownType("Scoring Consistency", "How consistent is the robot at Scoring?", new String[]{"Does not work", "Worked a few times during testing", "Works most of the time", "Fails sometimes", "Never fails"}, 0),
|
||||
|
||||
new dropdownType("Auto type", "What autos does this team have?", new String[]{"No auto", "Simple Coral", "Simple Algae", "Complex Coral", "Complex Algae", "Other, Info in comments"}, 0),
|
||||
new sliderType("Auto Consistency", "How reliable is this auto;?", 5, 0, 10),
|
||||
new dropdownType("Auto Consistency", "How consistent is the robot at Auto?", new String[]{"Does not work", "Worked a few times during testing", "Works most of the time", "Fails sometimes", "Never fails"}, 0),
|
||||
|
||||
new dropdownType("Climb type", "What does the robot do to climb?", new String[]{"No Climb", "Only Shallow", "Only Deep", "Both Shallow and Deep"}, 0),
|
||||
new dropdownType("Climb Consistency", "How consistent is the robot at climbing?", new String[]{"Does not work", "Worked a few times during testing", "Works most of the time", "Fails sometimes", "Never fails"}, 0),
|
||||
|
||||
new textType("Comments", "Things go here", "Day 1:\n\nDay 2:\n\nDay 3:\n")
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
package com.ridgebotics.ridgescout.types.data;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public abstract class dataType {
|
||||
public enum valueTypes {
|
||||
NUM,
|
||||
|
||||
@@ -219,5 +219,9 @@ public class checkboxType extends inputType {
|
||||
chart.invalidate();
|
||||
parent.addView(chart);
|
||||
}
|
||||
|
||||
public String toString(dataType data){
|
||||
return (int) data.get() == 1 ? "true" : "false";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -245,5 +245,9 @@ public class dropdownType extends inputType {
|
||||
chart.invalidate();
|
||||
parent.addView(chart);
|
||||
}
|
||||
|
||||
public String toString(dataType data){
|
||||
return text_options[(int) data.get()];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -232,5 +232,10 @@ public class fieldposType extends inputType {
|
||||
|
||||
parent.addView(chart);
|
||||
}
|
||||
|
||||
public String toString(dataType data){
|
||||
int[] intarr = (int[]) data.get();
|
||||
return "[" + intarr[0] + "," + intarr[1] + "]";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -107,4 +107,7 @@ public abstract class inputType {
|
||||
|
||||
|
||||
public abstract void add_history_view(LinearLayout parent, dataType[] data);
|
||||
|
||||
|
||||
public abstract String toString(dataType data);
|
||||
}
|
||||
@@ -318,5 +318,9 @@ public class numberType extends inputType {
|
||||
|
||||
parent.addView(chart);
|
||||
}
|
||||
|
||||
public String toString(dataType data){
|
||||
return String.valueOf((int) data.get());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -305,4 +305,8 @@ public class sliderType extends inputType {
|
||||
|
||||
parent.addView(chart);
|
||||
}
|
||||
|
||||
public String toString(dataType data){
|
||||
return String.valueOf((int) data.get());
|
||||
}
|
||||
}
|
||||
@@ -298,5 +298,9 @@ public class tallyType extends inputType {
|
||||
|
||||
parent.addView(chart);
|
||||
}
|
||||
|
||||
public String toString(dataType data){
|
||||
return String.valueOf((int) data.get());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -230,5 +230,9 @@ public class textType extends inputType {
|
||||
parent.addView(chart);
|
||||
|
||||
}
|
||||
|
||||
public String toString(dataType data){
|
||||
return String.valueOf(data.get());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ public class CustomSpinnerView extends LinearLayout {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
|
||||
|
||||
ScrollView sv = new ScrollView(getContext());
|
||||
sv.setLayoutDirection(ScrollView.SCROLL_AXIS_VERTICAL);
|
||||
// sv.setLayoutDirection(ScrollView.SCROLL_AXIS_VERTICAL);
|
||||
|
||||
LinearLayout ll = new LinearLayout(getContext());
|
||||
ll.setOrientation(LinearLayout.VERTICAL);
|
||||
@@ -94,7 +94,7 @@ public class CustomSpinnerView extends LinearLayout {
|
||||
|
||||
ll.addView(popup);
|
||||
|
||||
popup.setLayoutDirection(0);
|
||||
// popup.setLayoutDirection(0);
|
||||
builder.setView(sv);
|
||||
AlertDialog dialog = builder.create();
|
||||
|
||||
|
||||
@@ -270,7 +270,7 @@ public class EventFragment extends Fragment {
|
||||
teamNums.add(String.valueOf(event.teams.get(i).teamNumber));
|
||||
|
||||
ScrollView sv = new ScrollView(getContext());
|
||||
sv.setLayoutDirection(ScrollView.SCROLL_AXIS_VERTICAL);
|
||||
// sv.setLayoutDirection(ScrollView.SCROLL_AXIS_VERTICAL);
|
||||
|
||||
LinearLayout ll = new LinearLayout(getContext());
|
||||
ll.setOrientation(LinearLayout.VERTICAL);
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.ridgebotics.ridgescout.scoutingData.ScoutingDataWriter;
|
||||
import com.ridgebotics.ridgescout.types.data.dataType;
|
||||
import com.ridgebotics.ridgescout.types.frcMatch;
|
||||
import com.ridgebotics.ridgescout.types.frcTeam;
|
||||
import com.ridgebotics.ridgescout.types.input.inputType;
|
||||
import com.ridgebotics.ridgescout.utility.DataManager;
|
||||
import com.ridgebotics.ridgescout.utility.fileEditor;
|
||||
|
||||
@@ -59,11 +60,14 @@ public class CSVExport {
|
||||
data += ("null,".repeat(match_latest_values.length));
|
||||
}else{
|
||||
try {
|
||||
String tempData = "";
|
||||
ScoutingDataWriter.ParsedScoutingDataResult psdr = ScoutingDataWriter.load(filename, DataManager.match_values, DataManager.match_transferValues);
|
||||
dataType[] types = psdr.data.array;
|
||||
dataType[] matchData = psdr.data.array;
|
||||
inputType[] types = psdr.data.values[psdr.data.values.length-1];
|
||||
for (int i = 0; i < types.length; i++) {
|
||||
data += (safeCSV(types[i].get().toString()) + ",");
|
||||
tempData += (safeCSV(types[i].toString(matchData[i])) + ",");
|
||||
}
|
||||
data += tempData;
|
||||
} catch (Exception e){
|
||||
e.printStackTrace();
|
||||
data += ("null,".repeat(pit_latest_values.length));
|
||||
@@ -108,11 +112,14 @@ public class CSVExport {
|
||||
data += ("null,".repeat(pit_latest_values.length));
|
||||
}else{
|
||||
try {
|
||||
String tempData = "";
|
||||
ScoutingDataWriter.ParsedScoutingDataResult psdr = ScoutingDataWriter.load(filename, DataManager.pit_values, DataManager.pit_transferValues);
|
||||
dataType[] types = psdr.data.array;
|
||||
dataType[] teamData = psdr.data.array;
|
||||
inputType[] types = psdr.data.values[psdr.data.values.length-1];
|
||||
for (int i = 0; i < types.length; i++) {
|
||||
data += (safeCSV(types[i].get().toString()) + ",");
|
||||
tempData += (safeCSV(types[i].toString(teamData[i])) + ",");
|
||||
}
|
||||
data += tempData;
|
||||
} catch (Exception e){
|
||||
e.printStackTrace();
|
||||
data += ("null,".repeat(pit_latest_values.length));
|
||||
|
||||
Reference in New Issue
Block a user