mirror of
https://github.com/Team4388/RidgeScout.git
synced 2026-06-09 08:38:03 -06:00
Compare commits
4 Commits
v1.1
...
Fix-CSV-Export
| Author | SHA1 | Date | |
|---|---|---|---|
| a15deda539 | |||
| 0846f5a3b3 | |||
| 554cad2abd | |||
| 7d41a5e5a9 |
@@ -25,8 +25,8 @@ android {
|
|||||||
applicationId = "com.ridgebotics.ridgescout"
|
applicationId = "com.ridgebotics.ridgescout"
|
||||||
minSdk = 24
|
minSdk = 24
|
||||||
targetSdk = 34
|
targetSdk = 34
|
||||||
versionCode = 8 // **IMPORTANT** Increment this before releasing on github
|
versionCode = 9 // **IMPORTANT** Increment this before releasing on github
|
||||||
versionName = "1.1"// **IMPORTANT** Change this before releasing on github (<Year num since 2024>.<Update Version>)
|
versionName = "1.2"// **IMPORTANT** Change this before releasing on github (<Year num since 2024>.<Update Version>)
|
||||||
|
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
package com.ridgebotics.ridgescout.types.data;
|
package com.ridgebotics.ridgescout.types.data;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
public abstract class dataType {
|
public abstract class dataType {
|
||||||
public enum valueTypes {
|
public enum valueTypes {
|
||||||
NUM,
|
NUM,
|
||||||
|
|||||||
@@ -219,5 +219,9 @@ public class checkboxType extends inputType {
|
|||||||
chart.invalidate();
|
chart.invalidate();
|
||||||
parent.addView(chart);
|
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();
|
chart.invalidate();
|
||||||
parent.addView(chart);
|
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);
|
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 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);
|
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);
|
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);
|
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);
|
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());
|
AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
|
||||||
|
|
||||||
ScrollView sv = new ScrollView(getContext());
|
ScrollView sv = new ScrollView(getContext());
|
||||||
sv.setLayoutDirection(ScrollView.SCROLL_AXIS_VERTICAL);
|
// sv.setLayoutDirection(ScrollView.SCROLL_AXIS_VERTICAL);
|
||||||
|
|
||||||
LinearLayout ll = new LinearLayout(getContext());
|
LinearLayout ll = new LinearLayout(getContext());
|
||||||
ll.setOrientation(LinearLayout.VERTICAL);
|
ll.setOrientation(LinearLayout.VERTICAL);
|
||||||
@@ -94,7 +94,7 @@ public class CustomSpinnerView extends LinearLayout {
|
|||||||
|
|
||||||
ll.addView(popup);
|
ll.addView(popup);
|
||||||
|
|
||||||
popup.setLayoutDirection(0);
|
// popup.setLayoutDirection(0);
|
||||||
builder.setView(sv);
|
builder.setView(sv);
|
||||||
AlertDialog dialog = builder.create();
|
AlertDialog dialog = builder.create();
|
||||||
|
|
||||||
|
|||||||
@@ -270,7 +270,7 @@ public class EventFragment extends Fragment {
|
|||||||
teamNums.add(String.valueOf(event.teams.get(i).teamNumber));
|
teamNums.add(String.valueOf(event.teams.get(i).teamNumber));
|
||||||
|
|
||||||
ScrollView sv = new ScrollView(getContext());
|
ScrollView sv = new ScrollView(getContext());
|
||||||
sv.setLayoutDirection(ScrollView.SCROLL_AXIS_VERTICAL);
|
// sv.setLayoutDirection(ScrollView.SCROLL_AXIS_VERTICAL);
|
||||||
|
|
||||||
LinearLayout ll = new LinearLayout(getContext());
|
LinearLayout ll = new LinearLayout(getContext());
|
||||||
ll.setOrientation(LinearLayout.VERTICAL);
|
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.data.dataType;
|
||||||
import com.ridgebotics.ridgescout.types.frcMatch;
|
import com.ridgebotics.ridgescout.types.frcMatch;
|
||||||
import com.ridgebotics.ridgescout.types.frcTeam;
|
import com.ridgebotics.ridgescout.types.frcTeam;
|
||||||
|
import com.ridgebotics.ridgescout.types.input.inputType;
|
||||||
import com.ridgebotics.ridgescout.utility.DataManager;
|
import com.ridgebotics.ridgescout.utility.DataManager;
|
||||||
import com.ridgebotics.ridgescout.utility.fileEditor;
|
import com.ridgebotics.ridgescout.utility.fileEditor;
|
||||||
|
|
||||||
@@ -59,11 +60,14 @@ public class CSVExport {
|
|||||||
data += ("null,".repeat(match_latest_values.length));
|
data += ("null,".repeat(match_latest_values.length));
|
||||||
}else{
|
}else{
|
||||||
try {
|
try {
|
||||||
|
String tempData = "";
|
||||||
ScoutingDataWriter.ParsedScoutingDataResult psdr = ScoutingDataWriter.load(filename, DataManager.match_values, DataManager.match_transferValues);
|
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++) {
|
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){
|
} catch (Exception e){
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
data += ("null,".repeat(pit_latest_values.length));
|
data += ("null,".repeat(pit_latest_values.length));
|
||||||
@@ -108,11 +112,14 @@ public class CSVExport {
|
|||||||
data += ("null,".repeat(pit_latest_values.length));
|
data += ("null,".repeat(pit_latest_values.length));
|
||||||
}else{
|
}else{
|
||||||
try {
|
try {
|
||||||
|
String tempData = "";
|
||||||
ScoutingDataWriter.ParsedScoutingDataResult psdr = ScoutingDataWriter.load(filename, DataManager.pit_values, DataManager.pit_transferValues);
|
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++) {
|
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){
|
} catch (Exception e){
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
data += ("null,".repeat(pit_latest_values.length));
|
data += ("null,".repeat(pit_latest_values.length));
|
||||||
|
|||||||
Reference in New Issue
Block a user